You are required to write a code that requires the user to enter positive integer numbers consecutively until a negative value is entered. The code should output the following numbers in the same order: maximum entered even number, miniumum entered even number, the average of all entered even numbers, maximum entered odd number, minimum entered odd number, the average of all entered odd numbers. If the user does not enter any even number, then the code should output the word None instead of the even numbers statistics. Similarly, if the user does not enter any odd number, then the code should output the word None instead of the odd numbers statistics.
You are required to write a code that requires the user to enter positive integer numbers consecutively until a negative value is entered. The code should output the following numbers in the same order: maximum entered even number, miniumum entered even number, the average of all entered even numbers, maximum entered odd number, minimum entered odd number, the average of all entered odd numbers. If the user does not enter any even number, then the code should output the word None instead of the even numbers statistics. Similarly, if the user does not enter any odd number, then the code should output the word None instead of the odd numbers statistics.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Concept explainers
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Question
c++, please solve the questionnnnnn

Transcribed Image Text:Sample Test Case 0
Input:
4 8 200 0 3 62 5 9 -6
Output:
200 0 54.8
93 5.66667
Sample Test Case 1
Input:
46 18 2-1
Output:
46 2 22
None
Sample Test Case 2
Input:
-3
Output:
None
None

Transcribed Image Text:You are required to write a code that requires the user
to enter positive integer numbers consecutively until
a negative value is entered. The code should output
the following numbers in the same order: maximum
entered even number, miniumum entered even
number, the average of all entered even numbers,
maximum entered odd number, minimum entered
odd number, the average of all entered odd
numbers.
If the user does not enter any even number, then the
code should output the word None instead of the
even numbers statistics. Similarly, if the user does not
enter any odd number, then the code should output
the word None instead of the odd numbers statistics.
IMPORTANT NOTES
I/O
• Do not add any cout statements except for the final
answers as shown in the sample cases. Do not add
"Enter a number", "The maximum odd number is"
or any similar prompts.
• There is exactly one space between the maximum,
the minimum, and the average of the entered even
number not add any unnecessary spaces.
• There is exactly one space between the maximum,
the minimum, and the average of the entered odd
numbers. Do not add any unnecessary spaces.
• The grader is case-sensitive; so "none" is wrong but
"None" is correct.
Program Input:
Non-negative integer values until a negative
value is entered.
Program Output:
The output is two lines. The first line contains
the maximum enetered even number, the
minimum entered even number, and the
average of all entered even numbers. Each two
numbers are separated by a space. When no
even numbers are entered, the first line
contains None. The second line contains the
maximum enetered odd number, the minimum
entered odd number, and the average of all
entered odd numbers. Each two numbers are
separated by a space. When no odd numbers
are entered, the second line contains None.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education