Im having trouble with figuring this out. Will someone please help me.
Problem: Write a program that computes the cost of a long-distance call. The cost of the call is determined according to the following rate schedule:
a. Any call started between 7:00 A.M. and 9:00 P.M., Monday through Friday, is billed at a rate of $0.30 per minute.
b. Any call started before 7:00 A.M. or after 9:00 P.M., Monday through Friday, is billed at a rate of $0.15 per minute.
c. Any call started on a Saturday or Sunday is billed at a rate of $0.10 per minute.
The input will consist of the day of the week, the time the call started, and the length of the call in minutes. The output will be the cost of the call. Input will come from the input file “Project_3_input.txt” and go to “Project_3_output.txt”, which you will create.
The day of the week will be read as one of the following pairs of character values, which are stored in two variables of type char: Mo Tu We Th Fr Sa Su
The time is to be input in military-time notation, hours followed by minutes, so the time 1:30 P.M. is input as: 13 30
Be sure to allow for both uppercase and lowercase letters or a combination of the two. You MUST accept both letters, and check both letters for validity. (Think: otherwise the program would accept “Sq” if you are only checking for weekend days by looking for “S”). If an incorrect day of the week is entered, skip the part of the code that will read in start time and call length.
The number of minutes will be input as a value of type int. (You can assume that the call time is rounded up to a whole number of minutes.) Your program should include a loop that accepts call data until the end of the file is reached.
this is my input file which i have as Project_3_input.txt
//*************************
Mo 17 30 15
Sa 9 00 30
Tu 3 30 45
Sq
Fr 21 01 60
//**************************
This is my code i have already (Instead of putting it in the output file right now i have it outputted to the screen.)
I would greatly appreciate it if someone could even give me advice on where to go from here. This program displays numbers and runs constantly until hitting the red "X".
Single quotes ' ' like this mean what's inside these is a character, not string... so this program shouldn't even run. Furthermore, comparing cstrings ("this is a cstring") doesn't work with the == operator, you would either have to use strcmp from the cstring header, or compare them with string::compare (string("cstring1").compare("cstring2")). Your "day" variable is also declared as a char, which means it's just a single character. You should use char* or string instead.