Hello guys i need your help to finish my project in computer programming so guys i need your help

problem: the new telephone company has the following rate structure for long-distance calls:
a. The regular rate for a call is $0.40 per minute
b. any call started after 6:00 PM(1800 hours) but before 8:00 AM(0800 hours) is discounted 50%.
c. any call longer than 60 minutes receives a 15% discount.
d. all call are subject to a 4% federal tax on the cost after any discount.


write a program(using turbo c) that take the start time for a call based on aa 24-hour clock and the length if the call in minutes.the gross cost(before any discounts or tax) should be displayed
followed by the net cost(after discount are deducted and tax is added).Use a function to display instructions to the program user, a function to compute the gross cost, and a
separate function to compute each discount amount.


thank you! in advance

Recommended Answers

All 3 Replies

Are you asking if your best using if/ else statements or case statements or are you asking for code that fullfils the above requirement ?

i think if/ else would be best but i think that may just be my preference really

Since the criteria aren't mutually exclusive, you'll need to use just if statements. What I mean by this is a call can be started after 6, and be longer than 60 minutes. If you use if/else you'll only get one of these.

I see no where in this that a case statement would be appropriate.

I agree with Momerath, but my explanation is that if the criteria is not discrete (in this case, it is a range) and they are not the same type (in this case is a mixed of clock time, number of calls, and minutes), if-else statement will be the answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.