LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 December 2 2013

aboudyba
Member

Help Before 12 midnight

A hospital desires to computerize its daily parking activity. The parking opens its doors from 8 AM till 8 PM. Therefore; they bought a device to issue cards, at the entrance gate upon the visitor request, showing the arrival time. Upon leaving the parking the same card is inserted again in the same device by an employee at the exit door in order to send as input both the arrival and the leaving time to the computer. You are asked to write a C++ program that accepts as input the arrival time and leaving time as being two float numbers (for example, if the arrival time is 12:30, it will be inputted as 12.30 and using the built in function: floor(12.30) will result in the float value 12.0 on the other hand, if the departure time is 4:42, it will be inputted as 4.42 and using the built in function: ceil(4.42) will result in the float value 5.0 since any fraction of an hour will be charged as a full hour). These two floats are used to calculate the time spent inside the parking and to output the amount due with an additional 10% VAT tax. The rates are fixed as follows $5 for the first three hours and $2 for each additional hour. Your program must loop as long as the cahier wants to and must display at the end of the day the amount collected from all visitors.
Pay attention to documentation and the use of meaningful variable names


i cannot seem to solve it c++
ill owe you programmers big time
thank you in advance

Last edited by aboudyba (December 2 2013)

Offline

#2 December 2 2013

yasamoka
Member

Re: Help Before 12 midnight

[READMEFIRST] How to ask questions

Homework
We are not here to solve your homework. You have to prove that you have placed effort to solve your homework prior to asking any question here. We are not smarter or at least we don't claim to be smarter than all the posters available all around the internet, so make sure you do your own research before posting your question.
Another thing you need to note which is very important, is that if you don't place some effort to solve your own problems, it means that you're not serious about your field and if you're not serious about your field, we will bash you in a very rude manner. Software Development and Systems Administration and the lot are already polluted with people that have just cheated their way into their jobs. Jobs, that are better suited for people that are quite capable of providing great benefits. Understand that we're not stupid, we can distinguish homework from anything else.
In summary, we will NOT carry you through your career.

At the very least show us a start. Tell us what you're thinking, what you've tried. Something.

Last edited by yasamoka (December 2 2013)

Offline

#3 December 2 2013

aboudyba
Member

Re: Help Before 12 midnight

#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
float enter,leave,sum,totaly;
enter=leave=sum=total=0.0;
floor (enter);
ceil (leave);
char $
$=0
cout<<"Check in time \n or $ to quite";
cin>>enter;
while (enter==$)
{ 
cout<<"Check out time \n";
cin>>leave;
if (leave-enter<=3)
sum=5;
else 
amount=(5+(leave-enter-3)*2)*1.1;
cout<<"Your fees are<<sum;
total+=sum;
}
cout<<"the totall fees are<<total<<endl;
system ("pause");
return 0;
}

Offline

#4 December 2 2013

MrClass
Member

Re: Help Before 12 midnight

My God the description of the program says it all. Nice try in having someone solve your homework. You just copied your professor's email info into a forum post: "You have the chance to get 110/100."

Last edited by MrClass (December 2 2013)

Offline

Board footer