April 19, 2014

Homework Help: Computer Programming

Posted by Dom on Tuesday, July 9, 2013 at 8:49pm.

I'm trying to create a vba code that solves this problem: 50 apartment units rent for 600 a month, for each 40 dollar increase in rent a unit becomes unoccupied. I want to find the max profit and number of units at that number.

Sub Rent()
Dim Rent As Variant
Dim increase As Integer
Dim units As Object
Dim Profit As Double
Rent = InputBox("The rent to occupy all the units")
increase = InputBox("The increase in rent that results in a vacant unit")
Rent = Rent + increasea
units = 50
Profit = units * (600 + increase)

Outputbox " " & units & " units and " & Profit & " when profit is maximized."
End Sub

Answer this Question

First Name:
School Subject:

Related Questions

Computer Information - A __________ provides the tools that a programmer uses to...
Computer Programming - Can anyone give me a site that contains a C source code. ...
Computer Programming - can anyone give me site about programming I need a sample...
Computer Programming - I am trying to put the following in Python Code. I know ...
Computer Programming - A babysitter takes care of 20 kids. When taking care of ...
it 210 computer programming - I need to generate an object oriented design for a...
computer science 104 - Create a method areaOfaTrapeziod when given a, b, and h (...
VBA Programming - I'm trying to create a macro that asks for a loan between 1 ...
Computer science - THIS IS C PROGRAMMING I NEED TO CREATE A METHOD! Create a ...
Programming - Hi. I am taking a computer programming class (C++). I need some ...