need help with hw

Part 1.
The program should display a menu with the following options:
Welcome to FastFreight Company.
You can select option from 1-3.
1. Add Freight Order
2. Display Freight Orders
3. Exit the system

The program should ask the user to select the option and then act as follows:
Selected Option Action
1 Call the function addFreightOrder and then display the menu to choose again.
2 Call the function, displayOrders and then display the menu to choose again.
3 Exit the program
Any other number Display an error and then display the menu to choose.

Part 2
Write a function to calculate the shipping charges.
It should accept distance and weight, as arguments. Distance and weight can be decimal numbers.
Input Validation:
Invalid Input Error Code
Values of 0 or less for the weight of the
package
-1
Weight of the package more than 20kg -2
Distance less than 8 miles -3
Distance more than 5000 miles -4
Function should use the following rates to calculate the charges:
Weight of Package (in Kilograms) Rate per mile
2 kg or less $0.50
Over 2 kg but not more than 6 kg $0.60
Over 6 kg but not more than 10 kg $0.80
Over 10 kg but not more than 20
kg
$1.10
Once the function is called with required arguments it should return the error code or the charges
accordingly.

2.addFreightOrder:
This function should ask user for a distance to be shipped and the weight of the parcel. Then call the function calculateFreightCharge to calculate the freight charges accordingly.
If the user enters valid inputs, then the function should generate a Freight ID as follows.
Use the first 4 digits on your student ID as the first Freight ID. Increment it by 1 for next freight.
Then add the details of the freight (Freight ID, FreightCharge and FreightStatus Code as ’W’ ) in to a file named freightData.txt. This txt file can be created in the same folder where you have to program stored.
Refer the file freightSampleData.txt to understand the required format for your output file.
If the user enters an invalid data, then the function should display an appropriate error messages. In such instance function should not add any data to freightData.txt file.
3. displayOrders:
This function should display all the freight order details stored in the file freightData.txt. If the file does not exist it should display appropriate error message.,
What's the problem?

You didn't post any code, do you need a help with code or help with understanding english :D
at least post some code and let us see where you fall short, you can't just expect someone to do all your homework for you.
Also, you didn't ask a question...
Topic archived. No new replies allowed.