- Details
- Parent Category: Programming Assignments' Solutions

# We Helped With This Excel (VBA) Programming Homework: Have A Similar One?

Category | Programming |
---|---|

Subject | Excel (VBA) |

Difficulty | Undergraduate |

Status | Solved |

More Info | Excel Macro Help |

## Assignment Description

**Problem 6 (12 points)**

A real estate office manages 50 apartment units. When the rent is $500 per month, all units are occupied. However, for each $50 increase in rent per month, one unit becomes vacant. How many units should be rented to maximize the profit?

Write a VBA program that prompts the user to enter:

a. (3 points) the rent to occupy all the units.

b. (3 points) the increase in rent that results in a vacant unit.

c. (6 points) you should display (clearly labeled) in a MsgBox the number of units rented to maximize profit and what the maximum profit at that number would be.

You must use a **FOR** loop in this problem.

Hint. First solve this problem by hand. Note all the steps you go through to reach your solution and note what the value is at solution. You may, ask clarifying questions at any time on this or any other question in this exam. I will not give solutions but will help clarify issues. If you are stuck on a piece of code, don’t spend a lot of time attempting to fix it, ask me and I will do my best to help without actually correcting the problem