![]() |
|
#1
|
|||
|
|||
Error C2106: '=' : left operand must be l-valueThe Program says: A long-distance carrier charges the following rates for telephone calls:
00:00-6:59 .12 per min 07:00-19:00 .55 per min 19:01-23:59 .35 per min Write a program that asks for the starting time and the number of minutes of call, and displays the charges. The program should ask for the time to be entered as a floating point number in the form HH.MM. For example, 07:00 hours will be entered as 07.00, and 16:28 will be entered as 16:28. Input validation: The program should not accept times that are greater than 23:59. Also, no number whose last two digits are greater than 59 should be accepted. Hint: Assuming num is a floating-point variable, the following expression will give you its fractional part: num - static_cast<int>(num) Here is my code Its half completed because I like to check and see if my logic works but if you have any alternative and much easier forms of code I would appreciate it very much Its due tommorow and it looks like im up tonight figureing this one out. I need help on this error that i get all the time. c:\users\sign on\documents\visual studio 2008\projects\long distance calls\long distance calls\long_ distance_ calls.cpp(36) : error C2106: '=' : left operand must be l-value Code: CPP / C++ / C Code:
Last edited by LuciWiz : 23-Sep-2008 at 03:24.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Help I keep getting this errorForgot to mention the error occurs at charges when it is first used in the if statement mixed with rate 1 etc.
|
|
#3
|
|||
|
|||
Re: Help I keep getting this errorQuote:
CPP / C++ / C Code:
In the future, please wrap your code with code tags ([cpp] before, & [/cpp] afterwards...) to both format your code & make it simpler for others you are hoping will spend their time reviewing. |
|
#4
|
|||
|
|||
Re: Help I keep getting this errorThanks man I appreciate you helping me with the error but I got fustrated and solved it a different way feel free to review the code now for the next program I hope your on just in case I need help
CPP / C++ / C Code:
|
|
#5
|
|||
|
|||
Re: Help I keep getting this errorQuote:
The best thing you can do both for yourself & for future discussion is be very clear as to the problem you are experiencing, & posting minimal code which generates the error seen. You would be surprised at how many people expect us to be mind readers. ![]() Good luck. |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 11:13 |
| Linked Lists advice request | promsan | C Programming Language | 74 | 23-May-2007 09:29 |
| Major newbie problem | cynack | MS Visual C++ / MFC Forum | 1 | 08-Apr-2007 12:25 |
| Winsock error when compiling FLTK 2.0 Projects | mauriciorossi | FLTK Forum | 3 | 16-Aug-2005 11:18 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 21:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The