c for enginner homework


Homework must be fully commented and with output
1.
(Writing to a file).
A damped sine wave is a sinusoidal function whose amplitude approaches zero as
time increases.
 
Write a program that will generate a data file containing 100 value points (Y(t)) from a damped sine function. Make use of the math library functions for the exponent and sine calculations. Use the following formula for time: t = (k-1)/10.0 where 1 ≤ k ≤100. Make sure that each record in your data file contains the fields for time and its corresponding Y(t).

2. (Reading from a file). The data file power1.dat contains a power plant output in megawatts over a period of 8 weeks. Each row of data contains 7 integers that represent 1 week’s data. Write a program that will compute and print to a file and to the screen the average power output over this period of time. Also print the number of days with greater-than-average power output.

 
 
Looking for a similar assignment? Our writers will offer you original work free from plagiarism. We follow the assignment instructions to the letter and always deliver on time. Be assured of a quality paper that will raise your grade. Order now and Get a 15% Discount! Use Coupon Code "Newclient"