Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simple Conditionals and LoopsWrite a program that repetitively requests signed integer numbers between -100 and +100 from the userthough the keyboard (using printf() and scanf())

Simple Conditionals and LoopsWrite a program that repetitively requests signed integer numbers between -100 and +100 from the userthough the keyboard (using printf() and scanf()) until the user enters 0 when she/he wants to quit. Test each entry for whether the number entered is positive or negative. Create two variables that accumulate the values of the numbers entered - one for the positive numbers and one for the negativenumbers. The program shall also ask the name of the user and save it to a string variable. Upon completion of the data entry process (when the user enters 0), the program prints out the name of the user, the number and the total of the positive numbers entered, and the number and the total of the negativenumbers entered. Then, it should also print out the algebraic total of the sum total of the positive entries minus the sum total of the negative entries. Furthermore, the users entry must be checked to ensure that it is within the range specified. If it is out of range, then it should print out Entry out of range. Please try again. It should furthermore give the user two more chances to enter a correct value. After two more chances, it should exit without providing an answer, and print out OK, were done here. Bye.There is no need to save any of the individual values during the program execution - only their cumulative totals and the number of positive and negative numbers (separately!) entered. The output should be as follows:, the numbers you have entered are broken down as follows: You entered positive numbers with a total value of You entered negative numbers with a total value of The algebraic sum of the total positive and negative entries is: Where the labels between <...> represent the values of the variables that will be printed in its place.

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

Step: 3

blur-text-image

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago