Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If statements: The code in the file generates a random integer between 1 and 100 . Write an if statement to determine if this number

If statements: The code in the file generates a random integer between 1 and 100 . Write an if statement to determine if this number is even. If it is even use disp to say so ("The number 4 is even."), and if not, say that the number is odd. Hint: The function mod is the key to writing this if statement. Having remainder 0 when divided by 2 means that a number is even. You'll want to use something like the previous part to include the random number that was generated in your sentence.

image text in transcribed
3. If statements: The code in the file generates a random integer between 1 and 100 . Write an if statement to determine if this number is even. If it is even use disp to say so ("The number 4 is even."), and if not, say that the number is odd. Hint: The function mod is the key to writing this if statement. Having remainder 0 when divided by 2 means that a number is even. You'll want to use something like the previous part to include the random number that was generated in your sentence

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions