Question 1

You are writing a silly calculator. First, you ask the user to enter an integer.
Then you ask them if they would like to know if that number is even, for it to
be squared, or for it to be multiplied with another number. The user will input "even"
"square" or "multiply" for these options, respectively.

For this question, we do not provide pseudocode -- consult
with the sample output to determine how your program should work specifically.

Enter an integer: 34 Would you like to know if this number
is even, square it, or multiply it with another number? Square

The square of this
number is: 1156

Enter an integer: 45 Would you like to know if this number
is even, square it, or multiply it with another number? Scallop

I don't know what
you're talking about.

Enter an integer: 19 Would you like to know if this number
is even, square it, or multiply it with another number? Even

It is odd!

Enter an integer: 23
Would you like to know if this number is even, square it, or multiply it with
another number? multiply What is the other number? 7

23 times 7 is 161

Question 2

You are making a
really un-fun game of "pocket monster battles." Users are asked to input the name and power
level of two monsters, and their power levels.
The monster with the greater power level wins. You declare who the
winner of their battle is.

If one monster is at least twice as powerful as the other,
you state that monster is "super efficacious!"

What is the name of the first monster? Squatle

What is the power level of the first monster? 320

what is the name of the second monster? Turnipsaur

What is the power
level of the second monster? 300

Squatle wins!

What is the name of the first monster? Burnmander

What is the power
level of the first monster? 9001

what is the name of the second monster? Pikachomp

What is the power level of the second monster? 9002

Pikachomp wins!

What is the name of
the first monster? VeeEee

What is the power level of the first monster? 4

what is the name of the second monster? Meowmathor

What is the power
level of the second monster? 4 It's a draw!

What is the name of
the first monster? Evennish

What is the power level of the first monster? 20

what is the name of the second monster? Nohtyp

What is the power level of the second monster? 50

Nohtyp wins!

Get Higher Grades Now

Tutors Online