Jump to content

Beginner@C

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Favorite Area of Science
    Laboratory

Beginner@C's Achievements

Lepton

Lepton (1/13)

0

Reputation

  1. Hi I'm kinda confused, searched on the web but didn't found any answer. I would like to know what is the formula for hours+minute (ex. 01:25) to minutes conversion. Thank you in advance!
  2. Ok I really didn't get that code and what you meant by it. Could you give me some hint on converting hours + minutes into minutes? Please! Would be greatful if you can. Thx for your replies.
  3. sorry for my variables, but If you saw the output which duration is 61 minutes. That is what's required for us to find out how they did it. If I convert 01:23 since midnight to minutes it would be 803 minutes and that is not what is instructed for us to do. My professor told me its something about the operator which I used is "duration=end-time;" any idea?
  4. Hello guys I need your help! Here's the problem 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. My code (sorry I'm new to programming in C); #include<stdio.h> main() { int time,end,ave; clrscr(); printf("Starting Time: "); scanf("%d", &time); printf("End Call Time: "); scanf("%d", &end); duration=end-time; printf("Duration of Call: %.0f minutes",duration); getch(); } The output should be : Starting time : 0123 End Time : 0224 Duration of Call : 61 minutes but my output is : Starting time : 0123 End Time : 0224 Duration of Call : 101 minutes the problem is my time management code which I have no idea how to convert 12hrs time to 24hrs (military time in turbo c) Any help? thx in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.