Question

In: Computer Science

Assign a button for each macro. Each macro should also receive its inputs through an input...

Assign a button for each macro. Each macro should also receive its inputs through an input box and display its outputs through a msgbox.

  1. Create a Sub called “GoodJudgment” that implements the flowchart below. Then, make it run by clicking a button.

  2. Create a Sub called “daisyDecisions” that runs when you click a button. In this subroutine, you will create a program that determines whether someone loves you, or loves you not. The program should receive, as an input, the number of petals on the flower (i.e., have a variable for petals) and then use that number to determine the output of the program: if the number of petals is even, then the program should output that the person loves you not. If the number of petals is odd, then the person loves you.

    Hint: Use the Mod operator to determine if a number is odd or even:

    The Mod operator will return the remainder of one number divided by another, for instance:

    11 Mod 2 = 1, 11 Mod 3 = 2, 11 Mod 4 = 3

    You can also apply this operator on variables (ie, myVariable Mod 2 would return the remainder of your variable divided by 2).

Be sure to write your code in a module in the workbook you will submit, not in your personal workbooks or sheets. To access the correct module, go to your “Visual Basic,” right-click “Microsoft Excel Objects” in the workbook you are submitting, and then click “Insert” and “Module.”

Solutions

Expert Solution

Code

Sub daisyDecisions()
Dim num_of_petals As Integer
  
num_of_petals = CInt(InputBox("Enter number of petals on the flower"))
If num_of_petals Mod 2 = 0 Then
MsgBox ("The Person Loves you not")
Else
MsgBox ("The Person Loves you")
End If
End Sub

Output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.


Related Solutions

Write a subroutine that will receive a char input value. This subroutine should then use a...
Write a subroutine that will receive a char input value. This subroutine should then use a switch statement to determine if the char is a vowel, consonant, digit, or other type of character. Write the subroutine only,
Write a subroutine that will receive a char input value. This subroutine should then use a...
Write a subroutine that will receive a char input value. This subroutine should then use a switch statement to determine if the char is a vowel, consonant, digit, or other type of character. Write the subroutine only, This is in C++
when sampling analog inputs, the input should be sampled at no more than twice the maximum...
when sampling analog inputs, the input should be sampled at no more than twice the maximum frequency of the signal being sampled.for an n bit analog to digital converter the input is converted to one of 2*n possible values (True or False?) Clarify
Maximum value and its index in an array java program that: Receive as input in command...
Maximum value and its index in an array java program that: Receive as input in command line the size of an array (n) Generate an array with numbers between 1 and 100 (inclusive 1 and 100) with the given size (a) Print the array with the format: {a, b, c, ..., x}, for instance {1, 2} Compute and print in the console the following: maximum value in the array one index on which the maximum value appears (a number from...
Minimum value and its position Create a program that: Receive as input in command line the...
Minimum value and its position Create a program that: Receive as input in command line the sizes m and n of a two dimensional array, and minValue and maxValue between which the random numbers will be generated Generate a array with numbers between minValue and maxValue (inclusive) with the given size (mxn) Compute the minimum value in the array and one of the rows and columns on which it appears. Print the array as a table. Print the minimum value...
A firm using MEc tools finds that the 2-inputs in its 2-input production arrangement is inefficient....
A firm using MEc tools finds that the 2-inputs in its 2-input production arrangement is inefficient. Describe how that inefficiency is manifested in terms of the inputs and spending. Also, briefly discuss the choice the firm faces with regard to outputs OR its budgetary outlays devoted to production. How could it spend less with the same budget?
a) Discuss the process of going public through an IPO. Your answer should also include the...
a) Discuss the process of going public through an IPO. Your answer should also include the Part played by the underwriter in the issuance of the IPO. b) With respect to fixed income securities, discuss the concept of: I. Treasury Bills II. Municipal Bonds
a) Discuss the process of going public through an IPO. Your answer should also include the...
a) Discuss the process of going public through an IPO. Your answer should also include the Part played by the underwriter in the issuance of the IPO.
You will receive $697 at the end each year in years 1 through 10, $2,024 in...
You will receive $697 at the end each year in years 1 through 10, $2,024 in years 11 through 20, and $2,547 in years 21 through 30. How much is all this worth today, if the required rate of return is 8%? GDebi, Inc. plans to issue 5.5 percent coupon bonds, with annual coupon frequency, 14 years to maturity and $1000 face value. If the prevailing market yield on bonds of similar riskiness and maturity is 6.1 percent, what would...
3) The Gross method of apportionment works as follows: Assign each state its lower quota. If...
3) The Gross method of apportionment works as follows: Assign each state its lower quota. If k states remain to be assigned, then assign them to the k largest states. a) Does the Gross method satisfy Quota rule? b) Does the Gross method satisfy Population monotonicity?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT