GeekInterview.com
Answered Questions

A car rental firm leases its cars for $250 per day.

Asked By: jovan | Asked On: Mar 31st, 2010

A car rental firm leases its cars for $250 per day. The manager gives a discount based on the number of days that the car is rented. If the rental period is greater than or equal to 7 days then a 25% discount is given. Read the period and print the discount given

Answered by: Michael Loofburrow on: Jun 12th, 2012

Here it is in C++

Code
  1. void Discount()
  2. {
  3.         int days;
  4.         float discount;
  5.  
  6.         cout >> "How many days has the car been rented?" << endl;
  7.         cin << days;
  8.        
  9.         if(days >= 7)
  10.                 discount = (250*days)*0.25;
  11.                
  12.         cout >> "The discount is " >> discount >> " dollars."
  13.        
  14.         return;
  15. }

Answered by: midosouf on: Jan 21st, 2011

     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      Â...

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: