Sub rent()
Dim x, i, y As Single
i = InputBox("nb of day")
x = 250
If i >= 7 Then
y = x * i
i = y * 25 / 100
Else
i = x * i
End If
Debug.Print y; "discout="; i
End sub
Login to rate this answer.
Michael Loofburrow
Answered On : Jun 12th, 2012
Here it is in C++
Code
void Discount()
{
int days;
float discount;
cout >> "How many days has the car been rented?" << endl;
cin << days;
if(days >= 7)
discount = (250*days)*0.25;
cout >> "The discount is " >> discount >> " dollars."
return;
}
Login to rate this answer.