i need help in my VBA assignment (for MIS major)
2021 – 2022
Fall 2021
Computing with Business Applications (MIS410)
Individual Assignment 3 (15%)
VBA Chapters 6 & 7
Start Date: 5 December 2021 - 17:00
Due Date: 11 December 2021 - 23:59
(Please upload your assessment on Moodle using Individual Assignment 3 submission link)
Student Name and ID:
1.
Section: U1
Total Earned Points: /100
Individual Assignment 3 Fall 2021 1
Answer the following THREE questions:
Write the VBA code for the following questions. Save your answers as an Excel Macro-Enabled Workbook with your name and ID (e.g. ahmad_alahmad_123456.xlsm). Please save your questions as different subs (e.g. Sub question1()). Upload your response to Moodle, through the Individual Assignment 3 link. Pease note that it is the students’ responsibility to save and upload their files properly. If your file cannot be viewed, or if you fail to upload or send your file on time, your grade will be zero.
1. Question 1: (35 Points)
Write VBA code for a hotel program. This program should accept Five values for Guest
ID, Guest name, number of nights, price per night, and total accommodation price from
the user.
(a) Set the value of Guest Id in cell A1.
(b) Set the value of Guest name in cell B1.
(c) Set the value of number of nights in cell C1.
(d) Set the value of price per night in cell D1.
(e) Set the value of total accommodation price in cell E1.
(f) Change the range A1 to E1 font color to yellow and the background color to red if
the total accommodation price is not correct, and font color to black and the
background color to green if the total accommodation price is correct.
(total accommodation price = price per night * number of nights)
2. Question 2: (15 Points)
Write VBA code for a program that reads two numbers from range B9 to C9 and display
the appropriate one of the following messages:
a. B9 < B9 value > is smaller than the C9 <C9 value>.
b. B9 < B9 value > is larger than the C9 <C9 value>.
c. Numbers are equal.
3. Question 3: (50 Points)
Write VBA code program for a gym subscription plan. Allow the user to enter the
number of months and the plan price. Assume that the user earns extra 20 percent
discount every month, while the maximum discount is 60 percent. The program output
is a schedule that lists each month's number in the gym subscription plan starting with
month 1 and the user’s savings at that month.
Example:
User entered 6 months gym subscription for 250 USD plan.
The output:
Month number 1 the discount percentage is 0% and the discount amount is 0 USD
Month number 2 the discount percentage is 20% and the discount amount is 50 USD
Month number 3 the discount percentage is 40% and the discount amount is 100 USD
Month number 4 the discount percentage is 60% and the discount amount is 150 USD
Month number 5 the discount percentage is 60% and the discount amount is 150 USD
Month number 6 the discount percentage is 60% and the discount amount is 150 USD