Your code seems to be in reasonable shape, except that it does not yet implement the algorithm to find the maximum revenue.
So the current revenue is 600*50=30,000$ a month.
Your program will increase the rent by $40 steps and recalculate the revenue.
When the revenue starts to decrease, then you have found the maximum revenue.
The programming part will include a for loop for implementing the increase, a method to calculate the new revenue, a variable to keep the old revenue, and an if statement to jump out of the loop when the revenue decreases.
The pseudocode would look something like this:
Define all variables
1. Input current rent (Rent=600$), number of units (Units=50), and critical increase (Increase=40$)
Current revenue (Revenue)=Units*Rent
2. Loop over increases
For inc=40 to Units*40 step40
If NewRevenue<revenue then exit loop
Rem: Found max. increase
If you implement the above pseudocode, you should get the correct result of $1300 as the most profitable rent with a revenue of $42250.
Computer Information - A __________ provides the tools that a programmer uses to...
Computer science - THIS IS C PROGRAMMING I NEED TO CREATE A METHOD! Create a ...
Computer Programming - Hoe do I write a program to Create a C++ console ...
Computer Programming - How do I understand how Java programming works?
Computer Programming - can anyone give me site about programming I need a sample...
Computer (Programming Logic and Design) - How do i Create a program that ...
it 210 computer programming - I need to generate an object oriented design for a...
computer - why are natural language not be suited for programming computer.
computer - To all computer programmer or people know or use computer programming...
Computer Science - Can anyone tell me where one could find help and advice for a...