I Need Your Help Please

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2005
Posts: 129
Reputation: some one is an unknown quantity at this point 
Solved Threads: 0
some one some one is offline Offline
Junior Poster

I Need Your Help Please

 
0
  #1
May 11th, 2005
please help me to write this program Ihave make one closed to it but I could not do it as what it says
here is the problem and my solution:

This is the program

Write a program that outputs a telephone bill, given information on telephone calls made by the user. A telephone call is described by:
- starting and stopping times, where the times are given in the form “hh:mm�
- date “dd/mm/yyyy�;
time cost / minute
00:00 - 07:59 0.10
08:00 - 16:59 0.15
17:00 - 23:59 0.12
The following table describes the cost of a phone call per minute.
• use pointer(s) to pass info to the BILL function;
• Try to use struct BILL;





the code:


  1. #include <iostream.h>
  2. int main()
  3. {
  4.  
  5. long int units,charge=0;
  6. float total;
  7. const int rent=25;
  8. cout << "Enter the number of units used : ";
  9. cin>>units;
  10. if(units>200)
  11. charge=(units-200)*20+150*40+50*60;
  12. else if(units>50)
  13. charge=(units-50)*40+50*60;
  14. else
  15. charge=units*60;
  16. total=0.01*charge+rent;
  17. cout << "You have used " << units << " units." << endl;
  18. cout << "Your total telephone bill is $" << total;
  19.  
  20. return 0;
  21. }
<< moderator edit: added [code][/code] tags >>
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,698
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 730
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: I Need Your Help Please

 
0
  #2
May 11th, 2005
How is your code close? You don't use loops to handle more than one record, you don't use a structure to store a single record, and you don't have a function that processes the records into a bill. I think you should talk to your instructor so that you have a better idea of what the requirements are before trying to write code.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 129
Reputation: some one is an unknown quantity at this point 
Solved Threads: 0
some one some one is offline Offline
Junior Poster

Re: I Need Your Help Please

 
0
  #3
May 12th, 2005
. I think you should talk to your instructor

i can not because she refuse to talk with her and she want the home wor at saturday
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 489
Reputation: Acidburn is an unknown quantity at this point 
Solved Threads: 5
Acidburn Acidburn is offline Offline
Posting Pro in Training

Re: I Need Your Help Please

 
0
  #4
May 12th, 2005
Then may i suggest going through your notes!
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,698
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 730
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: I Need Your Help Please

 
0
  #5
May 12th, 2005
>she refuse to talk with her
Then complain! It's her job to teach and help you. You're paying her good money to show you how to program, so force her to do it. I mean please, if you don't even have detailed requirements for the homework, how can you be expected to do it?
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 129
Reputation: some one is an unknown quantity at this point 
Solved Threads: 0
some one some one is offline Offline
Junior Poster

Re: I Need Your Help Please

 
0
  #6
May 12th, 2005
beleve me she descuss the homework after we give it to her so I need it to be right

thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 117
Reputation: subtronic is an unknown quantity at this point 
Solved Threads: 0
subtronic's Avatar
subtronic subtronic is offline Offline
Junior Poster

Re: I Need Your Help Please

 
0
  #7
May 12th, 2005
Originally Posted by some one
beleve me she descuss the homework after we give it to her so I need it to be right

thanks
Write out your program out in pseudo-code (how you think its suppose to work) and post it. I can begin to help (and teach) you, then.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,698
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 730
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: I Need Your Help Please

 
0
  #8
May 12th, 2005
>beleve me she descuss the homework after we give it to her so I need it to be right
You have a **** poor teacher. I can see it now:

Teacher: "This is your homework: <Something dreadfully vague>"
Class: "But how do we do it?"
Teacher: "That's what you're here for, to learn"
Class: "But you didn't teach us anything!"
Teacher: "We'll discuss the homework after you turn it in and fail"
Class: "WTF!"

And you people just keep letting yourselves get shafted. What a crock. If you're paying someone to teach you how to do something, you should get your money's worth our of it.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 129
Reputation: some one is an unknown quantity at this point 
Solved Threads: 0
some one some one is offline Offline
Junior Poster

Re: I Need Your Help Please

 
0
  #9
May 13th, 2005
subtronic

thanks I post my program at the first

subtronic

i do not have notes here is my solution

Narue
as if you where with us in the class

thanks
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,698
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 730
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: I Need Your Help Please

 
0
  #10
May 13th, 2005
>as if you where with us in the class
It's the only logical conclusion, and I'm thankful that I'm not in your class.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC