FIINC
03-10-2003, 05:17 PM
Internet Costs Calculation program.
I have to write a program as part of my module assesment which has to calculate the costs i have incurred with my imaginery Internet Service Provider in the previous month.
Program Specifications
Basic
1. Peak rate: 0.1p per second
2. Normal rate: 0.1p per minute
Ask for the number of calls made (of each type: peak/normal) in hours, minutes and seconds in that month.
Reject inappropriate values and stop at that point.
Calculate and display the amount spent on peak rate calls.
Calculate and display the amount spent on normal rate calls.
Display the total amount spent overall.
Display the total bill.
Intermediate - Your program can correctly achieve all of the above, plus the following:
After you have entered the details for one month, the program will ask you if you want to work out another bill; if you choose to do so, the program will work out the new bill (as before). If the user decides not to work out a new bill, the program finishes with a short message. (You can assume that you have paid off last month's bill before the new bill is calculated.)
Also, the user has the choice of 2 different types of contract and can choose which one they are on. The details of these contract types is stored in the program. The program performs the same calculations as above, but displays the results for the contract type chosen by the user.
The charges on these contracts are:
1. Peak rate: 0.1p per second
Normal rate: 0.1p per minute
2. Peak rate: 0.5p per second
Normal rate: 0.1p per minute
____________________________________________________________________________________
I have tried to do the first bit but my program fails in terms of not calculating correctly the totalAmount and it doesn't seem to accept values for my variable "callsMade_hours" bigger than 10!
The max time i can have in secs for a months is 2592000secs.
10 hours = 10*3600 secs = 36000secs
Can anyone please have a look at the code and give me some tips of how to complete it.
Thank you for your time:)!
I have to write a program as part of my module assesment which has to calculate the costs i have incurred with my imaginery Internet Service Provider in the previous month.
Program Specifications
Basic
1. Peak rate: 0.1p per second
2. Normal rate: 0.1p per minute
Ask for the number of calls made (of each type: peak/normal) in hours, minutes and seconds in that month.
Reject inappropriate values and stop at that point.
Calculate and display the amount spent on peak rate calls.
Calculate and display the amount spent on normal rate calls.
Display the total amount spent overall.
Display the total bill.
Intermediate - Your program can correctly achieve all of the above, plus the following:
After you have entered the details for one month, the program will ask you if you want to work out another bill; if you choose to do so, the program will work out the new bill (as before). If the user decides not to work out a new bill, the program finishes with a short message. (You can assume that you have paid off last month's bill before the new bill is calculated.)
Also, the user has the choice of 2 different types of contract and can choose which one they are on. The details of these contract types is stored in the program. The program performs the same calculations as above, but displays the results for the contract type chosen by the user.
The charges on these contracts are:
1. Peak rate: 0.1p per second
Normal rate: 0.1p per minute
2. Peak rate: 0.5p per second
Normal rate: 0.1p per minute
____________________________________________________________________________________
I have tried to do the first bit but my program fails in terms of not calculating correctly the totalAmount and it doesn't seem to accept values for my variable "callsMade_hours" bigger than 10!
The max time i can have in secs for a months is 2592000secs.
10 hours = 10*3600 secs = 36000secs
Can anyone please have a look at the code and give me some tips of how to complete it.
Thank you for your time:)!