1 / 11

Assignments

Assignments. Assignment 1. Write a program to calculate the current equation Where p is the period of pendulum in seconds, g=980 cm/sec 2 (acceleration), L is the pendulum length in cm,  is the angle of displacement in degrees. Assignment 2.

Download Presentation

Assignments

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Assignments

  2. Assignment 1 Write a program to calculate the current equation Where p is the period of pendulum in seconds, g=980 cm/sec2 (acceleration), L is the pendulum length in cm,  is the angle of displacement in degrees.

  3. Assignment 2 Suppose that the gas company bases its charges on consumption according to the following table:

  4. Continue of assignment 2 Meter readings are four-digit numbers that represent cubic meters. Write a program in which the meter reading for the previous month and the current meter reading are entered and then the amount of the bill is calculated. The current reading may be less than the previous one; for example the previous reading may have been 9897, and the current one is 0103. Use IF statement.

  5. Assignment 3 Write a program to read a set of numbers, and calculate the mean, variance, and standard deviation of the set of numbers. The mean and variance  of numbers x1, x2, …, xn can be calculated using the following formulas: The standard deviation is the square root of the variance.

  6. Assignment 4 Write a program to read a collection n of sets k of positive numbers, and calculate the mean, variance, and standard deviation for each set k of numbers. Write i for 1,..,i,..n and the corresponding calculated values in a file. The mean and variance of numbers x1, x2, …, xk can be calculated using the following formulas: The standard deviation is the square root of the variance.

  7. Assignment 5 Write a program that includes a function that calculates the equation F= xnsin x. Write the values n, x, and F on the screen and in a file ‘data_f.data’. Repeat the program for positive n.

  8. Assignment 6 Write a program that uses a module that calculates the equation: Both denominator and nominator are calculated by two different functions. Write the values n, x, and F on the screen and in a file ‘data_f’. Repeat the program for positive n.

  9. Assignment 7 Write a program that reads the diameters and heights of several right circular cylinder and displays the circumference, total surface area (including the ends), and the volume of each. Circumference (C)= 2  r ; where r is the radius Total surface area = C (h+r); where h is the height Volume =  r2 h. Use one subprogram to calculate above equations.

  10. Assignment 8 Write a function that accepts an integer N and returns an array containing the first N square root of Repeat the program for positive N.

  11. Assignment 9 Write a program to read an array of numbers from the user, and use one subprogram to calculate the mean, variance, and standard deviation of the set of numbers. Use query control method to repeat the program. The mean and variance  of numbers x1, x2, …, xn can be calculated using the following formulas: The standard deviation is the square root of the variance.

More Related