Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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 rst integer, and alter each subsequent integer entered, ask the user if they wish to enter another integer. If they answer "r\" or 'y' then repeat, it they answer 'N' , 'n' , or any ether 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 rst 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: {data in angle brackets is user input followed by the Enter key:- Test Case 1: Enter an integer: sTe F' is odd. Do you have another integer to enter (YIN)? Y Enter an integer: {-5} -5 is odd. Do you have another integer to enter (YIN)? y Enter an integer: 4:15} 1B is even. Do you have another integer to enter (WNW: 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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions