Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Please Lab 10 Ask the user to enter an integer (positive or negative does not matter). Repeat the integer given by the user and

C++ Please image text in transcribed
Lab 10 Ask the user to enter an integer (positive or negative does not matter). Repeat the integer given by the user and tell them whether it is even or odd. After the user enters the first integer, and after each subsequent integer entered, ask the user if they wish to enter another integer. If they answer 'Y' or 'y' then repeat, if they answer 'N', 'n or any other character then tell them how many odd numbers they entered and how many even numbers they entered. Note that the user should always enter at least one integer only ask them if they have another after the first entry. Think about the three types of loops we have learned (while, do-while and for) and choose the most appropriate type for this problem. You should test your program and make sure it works before asking me to check it off! The examples below are test cases. Your code should work properly with all test cases listed, as well as with other inputs. Please test your code with all test cases included with each lab, and have these test cases already run and on screen when you call me over to check you off. Example Output Test Case 1: Enter an integer: 7 is odd. Do you have another integer to enter (Y/N)?: Y Enter an integer: -5 is odd. Do you have another integer to enter (Y/N)?:y Enter an integer: 16 is even. Do you have another integer to enter (Y/N)?: N Odd numbers: 2 Even numbers: 1

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago