Question: Task 2 demonstrate two-way if else and augmented assignment operator a. Prompt the user to enter an integer that is a multiple of 7. Store

Task 2 demonstrate two-way if else and augmented assignment operator

a. Prompt the user to enter an integer that is a multiple of 7. Store the value entered.

b. Write an if-else statement that will check input to verify the number entered is a multiple of 7.

When the input is a multiple of 7, print the words Input Verified

When the input is not a multiple of seven,

determine the amount need to subtract from the number to make the input divisible by 7,

use an augmented assignment operator to subtract that number from the input to make it evenly divisible by 7,

print the words Input Corrected along with the corrected number

For example:

If the user enters 14, your program would print: Input verified.

If the user enters 17, your program would print: Input corrected to 14

If the user enters 22, your program would print: Input corrected to 21

c. Run the program several times to verify it is working

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To address Task 2 we will create a simple program that solicits an integer from the user checks if it is a multiple of 7 and then either confirms the ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!