| | |
I Need Your Help Please
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2005
Posts: 129
Reputation:
Solved Threads: 0
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:
<< moderator edit: added [code][/code] tags >>
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:
C++ Syntax (Toggle Plain Text)
#include <iostream.h> int main() { long int units,charge=0; float total; const int rent=25; cout << "Enter the number of units used : "; cin>>units; if(units>200) charge=(units-200)*20+150*40+50*60; else if(units>50) charge=(units-50)*40+50*60; else charge=units*60; total=0.01*charge+rent; cout << "You have used " << units << " units." << endl; cout << "Your total telephone bill is $" << total; return 0; }
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.
>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?
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.
•
•
•
•
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
>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.
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.
![]() |
Other Threads in the C++ Forum
- Previous Thread: The recommended IDE
- Next Thread: class toString() functionality in C++ ...?
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






