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,
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
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?
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?
Comments using # and "" "should also be included for reader to understand each part. Question:...
Comments using # and "" "should also be included for reader to understand each part. Question: 14. Write in python a script code which tells the user to enter an integer bigger than 5. Any input numbers which are smaller than 5 or 5 are not considered by this script. The code then should output all the prime numbers starting at 5, which are smaller than the number inputted by that user.
Compare problems of conduct and problems of performance. Also, describe how each should be addressed.
Compare problems of conduct and problems of performance. Also, describe how each should be addressed.
Amalgamated General Corporation is a consulting firm that also offers financial services through its credit division....
Amalgamated General Corporation is a consulting firm that also offers financial services through its credit division. From time to time the company buys and sells securities. The following selected transactions relate to Amalgamated’s investment activities during the last quarter of 2018 and the first month of 2019. The only securities held by Amalgamated at October 1 were $35 million of 10% bonds of Kansas Abstractors, Inc., purchased on May 1 at face value and held in Amalgamated’s trading portfolio. The...
Amalgamated General Corporation is a consulting firm that also offers financial services through its credit division....
Amalgamated General Corporation is a consulting firm that also offers financial services through its credit division. From time to time the company buys and sells securities. The following selected transactions relate to Amalgamated’s investment activities during the last quarter of 2021 and the first month of 2022. The only securities held by Amalgamated at October 1, 2021 were $40 million of 10% bonds of Kansas Abstractors, Inc., purchased on May 1, 2021 at face value and held in Amalgamated’s trading...
Amalgamated General Corporation is a consulting firm that also offers financial services through its credit division....
Amalgamated General Corporation is a consulting firm that also offers financial services through its credit division. From time to time the company buys and sells securities. The following selected transactions relate to Amalgamated’s investment activities during the last quarter of 2018 and the first month of 2019. The only securities held by Amalgamated at October 1 were $40 million of 10% bonds of Kansas Abstractors, Inc., purchased on May 1 at face value and held in Amalgamated’s trading portfolio. The...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT