+ 1
I need help solving this problem please help me
The owner of a parking lot requires a program that allows him to determine how much he should charge for the use of the parking lot to his clients. The rates they have are as follows. The first two hours to $ 5.00 each. The next three to $ 4.00 each. The next five to 3.00 c / u. I need to solve the problem is a task for the course I attend
18 Respuestas
+ 2
jajaj significa que por cada hora me cobraría 5pesos por ejemplo
Hahaha means that for every hour I would charge 5pesos for example
+ 2
gracias por su ayuda
Thanks for your help, thank you very much
+ 1
well with C++ u have the time function to save in a var then you can use if else statements to full the money part of it. or simply have an cin inout of hours then if or switch statements
+ 1
i think continued
+ 1
ahhh ok
+ 1
Try having the code get the inputed hours from you or make a timer. then it takes that time and runs through the series of hours and chrages based on that
+ 1
I would use if statements for each of the ten hours.
That may not be good enough for a school solution.
like
edit or a set of three double conditionals
if ( hour > 0 && hour <=2){
return cost += 5;
}
+ 1
Thats exactly how i would make it are switch statements but time can be complicated with those
+ 1
True but may run faster then nested if
+ 1
You are welcome I hope that you do well in your course and enjoy coding
+ 1
@Nulled
True again,
C++ is already fast, and the code would be simple.
+ 1
@Manual
Ahh ok im still learning all of this too. All ik that professors like fast and accurate lol
+ 1
@Victor
De nada
+ 1
@Nulled
That makes sense, its a good practice.
+ 1
@Manual
Thanks. Also thank you for your help with this and the knowledge you gave us both.
+ 1
Your welcome!
0
what is c / u?
0
@Nulled
Switch statements would tske up more lines.