Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help on this question. I don't know how to use while loops. Can you help me by teaching me what they are and

I need help on this question. I don't know how to use while loops. Can you help me by teaching me what they are and how to use them? thank you.image text in transcribed

Part A. Write a program WhileLoops that uses while loops to perform the following steps 1. Prompt the user to input two positive integers: firstNum and secondNum (firstNum must be smaller than secondNum). 2. Output all the even numbers between firstNum and secondNum inclusive 3. Output the sum of all the even numbers between firstNum and secondNum inclusive. 4. Output all the odd numbers between firstNum and secondNum inclusive. 5. Output the sum of all the odd numbers between firstNum and secondNum inclusive. EXAMPLE OUTPUT: Enter an integer: Enter another integer larger than the first one 10 Even numbers 4 6 8 10 Sum of even numbers 28 Odd numbers 3 5 7 9 sum of odd numbers F 24

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 Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions