Question
Write a script to read four numbers and find the sum of these numbers. If the sum is more than 150 it should display the
Write a script to read four numbers and find the sum of these numbers. If the sum is more than 150 it should display the sum is more than 150 and in a different line display each of the four values and as well as the sum of those four numbers.
If the sum is in the range 100 to 149 display the message that the sum is in the range of 100 to 149 and display the first three numbers only.
If the sum is in the range 50 to 99 display the message that the sum is in the range of 50 to 99 and also display the first two numbers only.
For any other sum value, display the sum is not in any expected ranges.
Ask if the user wants to try one more time, if so continue this process.
If the user does not want to continue, thank the user for entering those values.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started