1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tpy6a [65]
3 years ago
10

Create a Sub called "daisyDecisions" that runs when you click a button. In this sub, you will create a program that determines w

hether he/she 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 he/she loves you not, if odd, then he/she loves you.

Computers and Technology
1 answer:
jenyasd209 [6]3 years ago
7 0

Answer:

see explaination

Explanation:

Please find the screenprint and the VBA code. As shown in the screenprint, range B1 is used to enter the number of petals. If you want to use a different cell for petals input, then change the code accordingly.

Also, the VBA code is placed in the Sheet1 module. No new modules are inserted.

Screenprint: see attachment for screenshot

VBA Code:

Private Sub CommandButton1_Click()

Call daisyDecisions

End Sub

Private Sub daisyDecisions()

Dim remainder As Integer

Dim noOfPetals As Integer

noOfPetals = Sheet1.Range("B1").Value

remainder = noOfPetals Mod 2

If remainder <> 0 Then

MsgBox "He/She loves you!!!"

Else

MsgBox "He/She loves you not!!!"

End If

End Sub

You might be interested in
Use the modulo operator (%) to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which
uranmaximum [27]

Hi, you haven't provided the programing language in which you need the code, I'll just explain how to do it using Python, and you can apply a similar method for any programming language.

Answer:

def rightMost(num):

   lenNum = len(str(num))

   rightNum = num%(10**(lenNum-1))

   print(rightNum)

   return(rightNum)

Explanation:

In this function we receive an integer number, then we find how many digits this number has, and finally, we find the rightmost digits; the main operation is modulo (takes the remainder after a division), what we want is to take all the digits except the first one, for that reason we find the modulo of the number when divided by ten to the power of the length of the number minus one, for example, if the number is 2734 we divided by 10^(4-1), where four is the length of the number, this way we get 2734/1000 and the module of it is 734.

5 0
3 years ago
3.5 Lesson practice quiz: Edhesive Question 5
Fed [463]

Answer:

There is an error, the else should be after the elif

Explanation:

5 0
2 years ago
3) According to the five-component model of information systems, the ________ component functions as instructions for the people
Ludmilka [50]

Answer:HUMAN RESOURCES AND PROCEDURE COMPONENTS

Explanation: Information systems are known to contain five components, these components help to describe the various aspects and importance of Information systems.

They Include The DATABASE AND DATA WAREHOUSE components(act as the store for all data), The COMPUTER HARDWARE(the physical components of the information systems such as computer harddrive etc)

THE COMPUTER SOFTWARE( the software which includes all the non physical and intangible assets of the information system),

THE HUMAN RESOURCES AND PROCEDURES COMPONENT( which gives instructions to the users).

THE TELECOMMUNICATIONS.

7 0
3 years ago
Memememememmemememememememmmeememememe
Alexus [3.1K]

l o l l o l l o l ha ha ha ha ha l o l

7 0
2 years ago
What is the basic process of programming?
NikAS [45]

Answer:

There are usually three stages to writing a program: Coding. Compiling. Debugging.

8 0
3 years ago
Other questions:
  • Do most facebook and twitter users access the platform from their personal computers?
    6·2 answers
  • How to get 60 fps pubg​
    9·2 answers
  • Which of the following is a true statement about psychological tests administered by computers? computers make standardization e
    9·1 answer
  • ____ are the computers that store network software and shared or private user files.
    6·1 answer
  • Henry went to an IT software company for an interview he was offered a position in lower level management which positions could
    11·1 answer
  • In two to three sentences, describe one advanced search strategy and how it is useful.
    13·1 answer
  • In the context of computer and network security, _____ means that a system must not allow the disclosing of information by anyon
    10·1 answer
  • 1. What does a computer
    7·2 answers
  • ________ was one of the first uses of the Internet
    15·2 answers
  • What is the maximum number of extended partitions can you have on a hard drive?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!