I'm need help!

+1 Misko Fatimic · January 17, 2015
I got a test of programming and if it can help if someone of good will.... every kind of help is appreciated, Maybe my english isn't really good...

1. task....
Write a program that allows the user to enter relan number x, integer no character.
Based on the entered character program should compute the following:
If the user has entered the character 'a' program should compute the following sum:
S=x+2*x^2+3*x^3+....+n*x^n

If the user entered character 'b' program should compute the following sum:
S=1-2+3-4+5-....(-1)^n*n

If the user entered character 'c' program should compute the following sum:
S = (1 + sin (x))*(1 + sin (x^2))*.......*(1 + sin (x^n))

Also, you should print the appropriate message occurs if incorre
whether one
  
2.task
Write a program that check whether one string appears as substring consecutive elements second string.
String entries from standard input, is assumed to be the first greater or equal Dimensions of Second.

Example 1: a = {1, 3, -2, 8, 4, -3}, b = {-2, 8, 4}. A series of b is a subsequence of consecutive elements string a.

Example 2: a = {1, 3, -2, 8, 4, -3}, b = {1, 8, -3}. The string is not a subsequence of consecutive elements string a

Post a Reply

Replies

Oldest  Newest  Rating
0 Misko Fatimic · January 17, 2015
3. task 
On the computer keyboard to enter a whole number ''x'' and a growing array of integers ''a" with a maximum of 100 elements.
Write a program that inserted number ''x'' in a series of numbers ''a''. so that after insertion string ''a'' stay
growing. We should especially check whether it is loaded series ''a'' growing.

example:

x = 31, a = {1, 3, 7, 12, 56, 74}, after inserting a = {1, 3, 7, 12, 31, 56, 74}.






4. task

write a function sin_f that accepts an argument of type double. The argument determines the point at which
the account value function sin, it being used for the calculation maclaurins polynom seventh degree(grade).
Maclaurin polynomial function of the seventh degree sin is:
Tn(x; sin, 0) = x - x^3/3! + x^5/5! - x^7/7!

In function main find the value of the argument xk=0.01 *k, k=0,.....,100
for which the absolute
value of the difference of results returned by sin_f and sin biggest. To standard output
show the values obtained, therefore, the value of the argument and the highest value of absolute differences.
under the function sin we mean the implementation declared in the header math.h
0 Mr. Computer · January 17, 2015
didn't get anything from ur questions 
0 Misko Fatimic · January 17, 2015
I now sow , in first sentence instead of Write a program that allows the user to enter relan number x, integer no character.

Shoud stay Write a program that allows the user to enter real number 'x', integer ''n'' and character...
  • 1

C

107,301 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator