c++ programming help please
Hi this is my first year at uni. Im studying engineering. Ive been given an assignment but im not sure what to do. If anybody can help me start off it would be great. Thanks in advance.
Problem Statement:
Write a program that displays the following menu:
First Year Physics Calculator
1. Calculate the period of oscillation of a pendulum
2. Calculate the maximum projectile height
3. Quit
Enter your choice (1-3):
If the user enters 1, the program should ask for the length of the pendulum in meters and then display the period of oscillation in seconds. Use the following formula:
where
T = the period in seconds
L = the length of the pendulum in meters
g = the acceleration due to gravity in ms-2.
Use 3.14159 for π. The program should display an error message if the length of the pendulum is less than 0 meters.
For valid inputs, the period of oscillation displayed should be formatted in fixed-point notation, with 2 decimal points of precision.
If the user enters 2, the program should ask for the initial velocity of the projectile in ms-1 and the initial angle of projectile in degrees. If the user enters an angle greater than 90 degrees or less than 0 degrees, the program should display an error message. Also if the user enters a velocity less than 0 ms-1, the program should display an error message. For valid inputs calculate and display the maximum projectile height using the following formula:
where
v = the initial velocity of the projectile in ms-1
α = the initial angle of the projectile
g = the acceleration due to gravity in ms-2.
For valid inputs, the period of oscillation displayed should be formatted in fixed-point notation, with 3 decimal points of precision.
If the user enters 3, the program should exit by displaying a message “Quitting …”.
For all other inputs the program should display an error message.
Use 9.8 m/s for the acceleration due to gravity (value of g).
For choices 1 and 2, the output for valid inputs should also be written to a file called prob1_<studentID>.txt in C:\Temp directory where <studentID> is your actual student ID. The input values must also be shown in the output file. The following show samples of the output file:
Sample output file for Choice 1:
Calculation of the period of oscillation of a pendulum
The length of the pendulum = 10.12 m/s
Period of oscillation = 6.39 seconds
Sample output file for Choice 2:
Calculation of the maximum projectile height
Initial velocity of projectile = 10.323 m/s
Initial angle of projectile = 45.343 degrees
The maximum height of projectile = 3.868 meters
If an error occurred in opening the output file, an error message should be displayed. For invalid inputs it is not necessary to write any outputs to the file.
EDIT: Im not asking for anyone to do my homework, Im asking for help.