Hi However's out there!
First of all I need to point out that I am not a lazy bum. I work full-time working for Nokia and am doing a MSc in Computer Science Conversion Course part-time (this means thta my Honours Degree was in Business and I have decided to do a completed different masters course to broaden my horizons). I have attended all my lectures (3 so far in C Programming) (and have spent considerable time out of lectures) but I already have an assignment that I am having problems with (it is very hard for me but probably really easy for you guys and I haven't been tought the subject area - they seem to do this on masters courses - maybe I should have choosen a subject that came more naturally to me such as business, but I really want to get into computing).
My problem is;
Part a)
Write a program that outputs a triangle to the screen. the user should be able to input the height of a triangle which should be some number between 1 and 20 inclusive. For example, if the user inputs a height of 5, the output should be;
Hint: Use a nested loop structure which minimises the number of printf() statements. Count the number of non-printing as well as the asterisk characters.Code:* *** ***** ******* *********
Part b)
Calculate the value of 'pi' from the infinite series;
The program should then print to screen two tables, each line being a calculated pi value followed by the number of terms used to calculate the value. The first table should be 10 lines which list the values of pi approsimated by 1 term of this series, by two two terms, by three terms and so on for the first 10 terms. the second table should print just two lines, depicting the first occurnace of 3.14 and 3.141 and their corresponding number of terms to get that degree of precision.Code:4 4 4 4 4 pi = 4 - - + - - - + - - - + ...... 3 5 7 9 11
To some of you this may seem really, really easy. I am sure others of you have been in this same position as me. I do not expect you to complete the whole code, I want to learn at the same time, but some pointers of what to go for for both parts of the questions would be brilliant.
I am sorry I have to clog up your message board with useless information and questions and please do not think of me as the usual lay-about student.
Thank you for you time, in not only reading this long message, but for hopefully helping me become one of you; an expert in C Programming.