Assignment 1
The report should be on paper and have the following sections:
A first side with
A short description of each sub-task, in your own words (do not copy the text from this assigmnet specification)
Source code (well commented).
Printouts from test runs, to show that the program works as intended
and finally some words about problems you might have had and other comments about the assignment.
The assignment should be completed individually.
Of course you may help each other, and discuss different solutions and methods, but the report and the programs
should be written by you, and if neccesary you should be able to explain in detail the function of the programs.
The report should be handed in at the latest at 12.00 on Friday the 17:th of November.
Assignment 1 consists of five sub-tasks:
sin(x) = x/1! - x^3/3! + x^5/5! - x^7/7! + …
Write a C-funtion sinus with the following prototype:
double sinus(double x, int n)
that calculates the sine of x with the help of n terms in the expansion.
Write a main program that uses your function and compares it with the built-in sin function, for some different values of x. Let the user type in values for x and n. If the built-in sin function uses the same method as you do, how many terms do you estimate that it uses ? Your function only has to be able to handle arguments in the range 0 to PI/2.
sirap i paris
a man a plan a canal Panama
ni talar bra latin
Write a program that read a text from the keyboard and checks whether it is a palindrome or not. If you want to you may use the built-in type string. Be particularily careful to check that the user doesn't type in more characters than your string can hold. Note that the program should not differentiate between upper and lower case, i.e. 'Anna' is regarded to be a palindrome. Also make sure that spaces are discarded.