program 3, Computer Programming, Programming Languages

Assignment Help:
An apartment complex has several apartments to rent. The apartments are all similar, and all rent for $750 per month. Currently, all units are occupied. The management, being in business to make money, would like to raise the rent charged for the apartments. However, for each $40 increase in rent, one unit becomes vacant. Furthermore, each occupied unit costs $27 per month, on average, in maintenance costs. Raising the rent brings in more income from the occupied units, but also leads to fewer units being occupied. What is the level of rent that results in maximum profit?
Write a program that asks the user:
? how many units are in the complex;
? the rent at which all units are occupied;
? the increase in rent that results in a vacant unit; and
? the cost to maintain a rented unit.
Each of these quantities are whole numbers, but must be > 0. If necessary, ask the user repeatedly until numbers > 0 are entered.
The program should report the amount of rent that results in the highest profit, the number of units that are occupied at that rent level, and the income (minus maintenance costs) that is expected at that occupancy level.
This company manages several complexes; therefore, the program should allow the user to enter information for as many complexes as desired.
Hints & Tips:
? This program is about iteration (loops). Starting with the full occupancy rate, compute the profit (income minus maintenance), raising rent in steps, until the profit starts to drop.
? Do this in stages. For example, as soon as you have a program that computes the profit at full occupancy, turn it in via Blackboard. Then add the loop computing what happens as the rent increases—then turn that in. Finally, add the logic allowing the user to do this for several apartment complexes.
? You may find it helpful to use a separate variable to record the profit at the previous rent level, so you can compare it to the current profit to see how it’s changing.
A sample run is shown below. Note that the dollar signs on the input are part of the prompt, and are not part of what’s input by the user.

Related Discussions:- program 3, Computer Programming

Java, wat is- m=5; n=3; x=m++-n+++m;

wat is- m=5; n=3; x=m++-n+++m;

Describe the term inter-process communication, UNIX Operating System 1....

UNIX Operating System 1. Explain all the layers present in a UNIX Architecture? List and explain each of them. 2. Describe the term Inter-Process Communication. What are var

What is url describe their protocol, What is URL describe theri protocol? ...

What is URL describe theri protocol? URL basicallt stands for uniform resource locator. A URL is a pointer to a particular resource on the Internet at a particular location.

Write a shell script to find the factorial of a given number, W.A.S.S to fi...

W.A.S.S to find the factorial of a given number. Program # W.A.S.S to find the factorial of a given number.    echo -e "enter number:\c"            #  \c Suppress trailing n

Find the general solution, Example : Find the general solution to the subse...

Example : Find the general solution to the subsequent differential equation. x 2 y′′ - 7 xy′ + 16 y= 0   Solution First the roots of (3)  r (r -1) - 7r + 16= 0 r 2

Service oriented architectures in xml, question 1: In the opening lecture I...

question 1: In the opening lecture I spoke about general changes in business - flatter organizations, process orientation as opposed to functional silos, focus on supply chains, gr

Program third command line argument, Most popular news websites publish the...

Most popular news websites publish their RSS ( Really Simple Syndication ) feeds. If you haven 't heard of RSS, you may have a look at this article on Wikipedia. In this assignm

Fortran programming, Question 1- In engineering applications it is often ne...

Question 1- In engineering applications it is often necessary to fit a straight line to a set of N points with known coordinates (xi, yi), where i indexes the points (N in total).

Write a complete program using floating-point operations, Question 1: a...

Question 1: a) Assume that B is an array of 50 words; write a code which will place the smallest integer of array B in register AX. b) Write a small code (only three instr

Oracle , PLEASE HELP ME ORACLE PROGRAMING TRIGGER

PLEASE HELP ME ORACLE PROGRAMING TRIGGER

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd