Homework #31) [30 points] You have just been hired by E*Trade, the leading provider of on-line trading on the Internet. Your first assignment is to write a stock analysis program which will enable customers to determine the current stock price of any company. For our purposes, however, you only have to worry about four publicly traded companies: Apple, IBM, Intel and Microsoft (see table below). Your program must provide the following functionality:
2) [30 points] Given r, the radius of a circle, the formula for the circumference of the circle is 2*PI*r. Write a function "circum", which takes a radius parameter, and returns the circumference. Once you have created your function, call the function within you main () function. For example: printf ("Circumference: %.2f", circum (2.5));To help get you started, here is the function prototype for circum: float circum (float);Hint: To use PI, you must use the #define preprocessor instruction. 3) [20 points] Do problem 4.16, parts (a) and (b) on page 141 of the book. You must use for loops here. 4) [20 points] Do problem 4.24 on page 142 of the book. Recall that a TRUE condition results in a value of 1, and a FALSE condition results in a value of 0. So the output for each printf() will be either 1 (if the condition is true) or 0 (if the condition is false). Note: in part d, there is a typo: where you see "< =", there should be no space; it should read "<=". |