Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Download below the macro - enabled Excel workbook file: Lastname.VBA.Conditionals.HW . xlsm . Save it using your last name. For example, Jones.VBA.Conditionals.HW . xlsm (
Download below the macroenabled Excel workbook file: Lastname.VBA.Conditionals.HWxlsm Save it using your last name. For example, Jones.VBA.Conditionals.HWxlsm using your last name rather than Jones Write your code in Module
Complete the two problems below on the same worksheet both buttons should be on Sheet and then save and submit your workbook.
Assign your code to the appropriate button on Sheet for each macro. Each macro should also receive its inputs through an inputbox prompt and display its outputs through a msgbox.
Create a Sub called DonutDiscount that implements the flowchart below. Then, make it run by clicking a button.multiple of thirteen, then the program should output, "That number is NOT a lucky number!"
Hint: Use the Mod operator to determine if a number is a multiple of thirteen:
The Mod operator will return the remainder of one number divided by another, for instance
Mod with a remainder of ; Mod with a remainder of
If the remainder then the number is a multiple of If the remainder is any other number, then the number is not a multiple of
You can also apply the Mod operator on variables ie myVariable Mod would return the remainder of myVariable divided by
Be sure to write your code in Module in the workbook.
Once completed, answer the following multiple choice questions:
Which of the following best reflects your submission?
I assigned my code to the buttons and they work ie they run the correct macrosub when I click them
I assigned my code to the buttons but they do not work properly maybe they run the wrong macro or no macro
I forgot to assign my code to the buttons
Run the LuckyNumber macro. Enter as a value. What do you get in return?
Something like: "That number is a LUCKY number!"
Something like: "That number is NOT a lucky number."
Bad output or no output
Run the LuckyNumber macro. Enter as a value. What do you get in return?
Something like: "That number is a LUCKY number!"
Something like: "That number is NOT a lucky number."
Bad output or no output
Run the DonutDiscount macro. Enter as a value. What do you get in return?
Something like: "Congratulations! That number of donuts qualifies for the discounted price!"
Something like: "Unfortunately, that number of donuts does not qualify for the discounted price!"
Bad output or no output
Run the DonutDiscount macro. Enter as a value. What do you get in return?
Something like: "Congratulations! That number of donuts qualifies for the discounted price!"
Something like: "Unfortunately, that number of donuts does not qualify for the discounted price!"
Bad output or no output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started