Question

(Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is, say,...

(Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. C++

However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance.

How many units should be rented to maximize the profit?

Instructions

Write a program that prompts the user to enter:

  1. The total number of units.
  2. The rent to occupy all the units.
  3. Amount to maintain a rented unit.
  4. The increase in rent that results in a vacant unit.

The program then outputs:

  1. The number of units to be rented to maximize the profit
  2. The maximum profit
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code -

#include <iostream>
using namespace std;

int main ()
{
//variable declare
double rent, maintenance, maintenanceCost,increaseRent;
double income,profit, maxProfit=0;
int n;
//ask user to enter rent to occupy all units
cout << "the rent to occupy all units: \t";
cin >> rent;
//ask user to enter the increase in rent that results in a vacant unit
cout << "\n the increase in rent that results in a vacant unit";
cin >> increaseRent;
//ask user to enter amount to maintain a rented unit:
cout << "\n amount to maintain a rented unit:\t";
cin >> maintenanceCost;
//output the rent
cout << "Rent" << " " << "Units" << " " << "Maintenance" << " " << "Income"<< " " << "Profit" << "\n";

for(int units = 50; units > 0; units--, rent += increaseRent)
{
income = units * rent;
maintenance = units * maintenanceCost;
profit = income - maintenance;
  
if (profit > maxProfit)
{
maxProfit = profit;
n = units;
}
  
cout << rent << " " << units << " " << maintenance << " " << income<< " " << profit << "\n";

}

cout << "\n number units to be rented to maximize profit is \t";
cout << n;
cout << "\n";

return 0;
}

Screenshots -

Add a comment
Know the answer?
Add Answer to:
(Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is, say,...
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
  • C++ (Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is,...

    C++ (Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Instructions Write a program that prompts the user to enter: The total number of units. The rent to occupy all...

  • PLEASE SHOW ALL WORK A company handles an apartment building with 50 units. Experience has shown that if the rent for each of the units is $720 per month, all of the units will be filled, but 1 unit w...

    PLEASE SHOW ALL WORK A company handles an apartment building with 50 units. Experience has shown that if the rent for each of the units is $720 per month, all of the units will be filled, but 1 unit will become vacant for each $20 increase in this monthly rate. (a) At what price is revenue maximum? What is the maximum revenue and how many apartments are rented to reach this max? (b) If the monthly cost of maintaining the...

  • All units in a 100-unit apartment building are rented out when the monthly rent is set...

    All units in a 100-unit apartment building are rented out when the monthly rent is set at r = $900/month. Suppose that one unit becomes vacant with each $10 increase in rent and that each occupied unit costs $80/month in maintenance. Which rent r maximizes monthly profit? r= $ A billboard of height b = 2 meters is mounted on the side of a building with its bottom edge at a distance h = 7 meters from the street. At...

  • A company handles an apartment building with 70 units. Experience has shown that if the rent...

    A company handles an apartment building with 70 units. Experience has shown that if the rent for each of the units is $1320 per month, all the units will be filled, but 1 unit will become vacant for each $20 increase in the monthly rate. What rent should be charged to maximize the total revenue from the building if the upper limit on the rent is $1420 per month?

  • (18) You own an apartment complex with 40 units. All units are occupied. The monthly rent...

    (18) You own an apartment complex with 40 units. All units are occupied. The monthly rent for 15 units is $1,100 per unit, and the monthly rent of the other 25 units is $1,400 per unit. The total maintenance cost is $3,000 per month for the entire complex. The property tax is $200 per month for the entire complex. Assume there are no other costs and also no changes in the rent, the maintenance cost, and the tax. The units...

  • wered [6 points] A real-estate firm owns 100 apartments. At 400 OMR per month, each apartment...

    wered [6 points] A real-estate firm owns 100 apartments. At 400 OMR per month, each apartment can be rented. However, for each 5 OMR per-month-increase, there will be one vacancies with no possibility of filling them. What rent per apartment will maximize monthly revenue?. of Maximum size for new files: 50MB estion Files You can drag and drop files here to add them. [6 points]

  • As the manager of a 60-unit motel you know that all units are occupied when you...

    As the manager of a 60-unit motel you know that all units are occupied when you charge $80 a day per unit. Each occupied room costs $56 for service and maintenance a day. You have also observed that for every x dollars increase in the daily rate above $80, there are 2x units vacant. Determine the daily price that you should charge in order to maximize profit. Calculate the number of occupied units. Assuming that fixed cost is $258 calculate...

  • Help ASAP

     (15 points) A company handles an apartment building with 50 units. Experience has shown that if the rent for each of the units is $720 per month, all of the units will be filled, but 1 unit will become vacant for each $20 increase in this monthly rate. At what price is revenue maximum? What is the maximum revenue and how many apartments are rented to reach this max?

  • 1. A certain town has 10,000 Occupied rental units. A local real estate office does a...

    1. A certain town has 10,000 Occupied rental units. A local real estate office does a survey of these units: 250 are chosen at random, and the occupants are interviewed about their rent paid in the previous month. The 250 sample rents have an average of $168. Assume the standard deviation of rent in this town is known to be $300 and that rents in this town are normally distributed. Find a 95% confidence interval for the average rent paid...

  • real estate case study Case Problem Allen Benedict is thinking of buying an apartment complex that...

    real estate case study Case Problem Allen Benedict is thinking of buying an apartment complex that is offered for sale by the firm of Getz and Fowler. The price, $2.25 million, equals the property's market value. The following statement of income and expense is presented for Benedict's The St. George Apartments Prior Year's Operating Results, Presented by Getz and Fowler, Brokers 30 units, al Washer and dryer rentals Gross annual income Less operating expenses apartments, $975 per month 351,000 361,000...

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
ADVERTISEMENT