![]() |
Hey Pf
I'm new this this site and need help writing a program...
I need to write a program that prompts the user for the number of minutes the call lasted and outputs the cost of the phone call. Format your output with two decimal places and a dollar sign in front can someone help me????? |
Re: Hey Pf
Please tell me that you attempted this homework yourself first. Show us some code or ask specific questions?
The cost of the call should be defined at the start, then read in the number of minutes (user input), multiple that by the cost variable and then display the total cost. |
Re: Hey Pf
Quote:
|
Re: Hey Pf
Have a look at the rules. Here's an excerpt:
Quote:
Welcome to the forum. |
Re: Hey Pf
my prgram is in C++ and I'm not asking for a quick answer. And yes I have attempted to write it. I'm stuck on the using the selection statement if or i could use switch.
|
Re: Hey Pf
>And yes I have attempted to write it.
I see no code that proves you've made an attempt. >I'm stuck on the using the selection statement if or i could use switch. Just pick one. They're functionally identical. |
Re: Hey Pf
Quote:
:
#include <iostream> |
Re: Hey Pf
If you were to tell us what errors you're getting, that imply that you're doing it wrong, we could zero in much faster. As it is, you're asking us to break out the crystal ball and read your mind. If you haven't read the "How to Post a Question" thread at the top of the C++ forum, please do so. Also, if you skipped by reading the rules, try that too.
While you're thinking about that, also think about testing your input operations (as in 'cin') for success. Read your documentation for the things you use. |
Re: Hey Pf
Quote:
I'm not getting an error, it's not calculating right.... |
Re: Hey Pf
How so? We can see your statements, but you haven't explained how the charges are supposed to be calculated. Have you tested to see that your input is correct? (I can see you haven't tested the input for failure, which is a bad thing to skip.) Have you worked your formulae by hand to see if they are what you expect?
Again, you're being overly reticent with the information. I'm sure we'll get to the bottom of your problem, but it's easier when it isn't like pulling hen's teeth. |
| All times are GMT -5. The time now is 3:26 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC