Question

The cost of renting a tool is $30 for the first three days, $10 per day...

The cost of renting a tool is $30 for the first three days, $10 per day for the next 5 days and $6 per day thereafter. If the input is the number of days the tool was rented, compute the cost of renting the tool. (C++)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>

using namespace std;

int main()
{
    int n, cost;
    
    cout<<"Enter number of days the tool was rented: ";
    cin>>n;
    
    if(n<=3){
        cost = n * 30;
    }
    else if(n<=8){
        cost = (3*30) + ((n-3)*10);
    }
    else{
        cost = (3*30) + (10*5) + ((n-8)*6);
    }
    
    cout<<"The cost of renting the tool: "<<cost<<endl;
    
    return 0;
}

Output:

Enter number of days the tool was rented: 7 The cost of renting the tool: 130

Add a comment
Know the answer?
Add Answer to:
The cost of renting a tool is $30 for the first three days, $10 per day...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • in python create a program to display the cost of renting a smart car. the user...

    in python create a program to display the cost of renting a smart car. the user must be able to enter the number of days he/she rents the cat and the number of miles driven. use constants for the flat rate per day and the flat rate per mile. the program will display the flat rate per day, flat rate per mile, and the total cost of the car rental.

  • A certain project has the following planned cost schedule: It will spend $400 per day for...

    A certain project has the following planned cost schedule: It will spend $400 per day for the first 4 days. It will spend $1,400 per day for the next 3 days. It will spend $2,200 per day for the next 5 days. It will spend $3,400 per day for the next 7 days. It will spend $4,700 per day for the next 7 days. It will spend $5,500 per day for the next 8 days. It will spend $4,200 per...

  • Baker premium is a company producing buns in a rented factory with the rental cost of $100 per day. The wage per worker...

    Baker premium is a company producing buns in a rented factory with the rental cost of $100 per day. The wage per worker is $40 per day. The table below shows the daily amount of buns produced with a different number of workers employed in the factory Workers Buns 1 30 2 70 3 130 4 210 5 260 6 300 7 320 8 330 (a) Compute and explain the minimum price per bun for Baker Premium to operate in...

  • Question: Kim operates a hotel at and charges guests $60 per day . Included in this...

    Question: Kim operates a hotel at and charges guests $60 per day . Included in this price is a free breakfast. Kim’s hotel has the capacity to rent 5,000 days per year. The hotel has the following costs: • Depreciation on the hotel is $60,000 per year. • Kim employs a maintenance person at an annual salary of $41,000 • Kim employs a cleaning person at an annual salary of $24,000. •Real estate taxes are $10,000 per year. •Costs for...

  • per donut is a daily cost. The cost of producing the first donut of the day...

    per donut is a daily cost. The cost of producing the first donut of the day is $5, the second donut of the day is $6 and so on. This holds for everyday Peter decides to produce. Peter is an architect who currently makes $15 a day in wages. He is considering leaving his job and opening a donut shop. The cost of producing donuts is $5 for the first donut and increases by $I for each subsequent donut produced...

  • Compute the fair value of the following three stocks. Assume cost of equity to be 10%...

    Compute the fair value of the following three stocks. Assume cost of equity to be 10% Stock A is expected to pay a uniform dividend of Rs. 3.50 per share forever. Stock B is expected to pay a dividend of Rs. 2.00 per share next year. Dividends are expected to grow at 5% YOY per year forever. Stock C has paid a dividend of Rs. 2.50 per share in the current year. The dividend is expected to increase by Rs....

  • Exhibit 7-5 Output per day Workers per day Total cost $10 50 7. In Exhibit 7-5,...

    Exhibit 7-5 Output per day Workers per day Total cost $10 50 7. In Exhibit 7-5, what is fixed cost at 20 units of output? a. $0 c. $30 b. $10 d. it is impossible to calculate fixed cost with the information in the exhibit. 8. In Exhibit 7-5, what are variable costs at 18 units of output? a. $30 d. $20 b. $10 e. $35 c. $1

  • A truck rental company rents a moving truck for one day by charging $30 plus $0.08...

    A truck rental company rents a moving truck for one day by charging $30 plus $0.08 per mile. Write a linear equation that relates the cost C, in dollars, of renting the truck to the number x of miles driven. What is the cost of renting the truck if the truck is driven 151 miles? 447 miles? Type the linear equation that relates the cost C, in dollars, of renting the truck to the number of x miles driven. (Use...

  • cost for machine tool are expected to be 1000$ at the end of the first year...

    cost for machine tool are expected to be 1000$ at the end of the first year of the machines life and increase 100$/year thereafter. The machine tools expected like is 15 years. The firms MARR is 10%/year. What is the annual worth of the maintenance cost? Draw the cash flow diagram to help solve. HINT End of year one tools are expected to be 1000$, and then increases 100$ thereafter up to 15 years. Show ALL WORK and EQUATIONS, and...

  • Is it better to receive 50,000$ per day for 30 days(1 month) or to receive one...

    Is it better to receive 50,000$ per day for 30 days(1 month) or to receive one penny on first day and have the amount you receive double each day for the month. On day 1 you will receive 1 cent. On day 2 you will receive 2 cents and have 3 cents in total. On day 3 you will receive 4 cents and have 7 cents in total. On day 4 you will receive 8 cents and have 15 cents...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT