Question
VBA PROGRAM: 4. Write a sub that asks the user for an integer such as 100 and stores it in the variable upperLimit. It then
VBA PROGRAM:
4. Write a sub that asks the user for an integer such as 100 and stores it in the variable upperLimit. It then asks the user for another integer such as 3 and stores it in the variable factor. It then creates an array called multiple, of the appropriate size, that contains all the multiples of factor no greater than upperLimit. Finally, it uses a loop to sum all of the elements in the array and reports this sum with an appropriate message in a MsgBox. For example, if the two inputs are 100 and 3, it should report The sum of all multiples of 3 no greater than 100 is 1683.
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