Write a java program that prompts the user to enter two integers, intl.eft and intRight, taking into consideration that intRight should be greater than intLeft. The program should display all the even and odd numbers between intl and int2 exactly as displayed in the sample runs below: Sample Run 1: Enter First Integer: 5 Enter Second Integer: 10 Even Numbers Are: 6, 8, 10, odd Numbers Are: 5, 7, 9, Sample Run 2: Enter First Integer: 1 Enter Second Integer: 10 Even Numbers Are: 2, 4, 6, 8, 10, odd Numbers Are: 1, 3, 5, 7, 9, Sample Run 3: Enter First Integer: 10 Enter Second Integer: 5 intRight should be greater than intLeft

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question
Pape 1 of 2
CSC1250
Sample Test I1
Fall 2020/2021
Question 1 150 pts).
Write a java program that prompts the user to enter two integers, intL.eft and intRight, taking
into consideration that intRight should be greater than intLeft. The program should display
all the even and odd numbers between intl and int2 exactly as displayed in the sample runs
below:
Sample Run 1:
Enter First Integer: 5
Enter Second Integer: 10
Even Numbers Are: 6, 8, 10,
Odd Numbe rs Are: 5, 7, 9,
Sample Run 2:
Enter First Integer: 1
Enter Second Integer: 10
Even Numbers Are: 2, 4, 6, 8, 10,
odd Numbers Are: 1, 3, 5, 7, 9,
Sample Run 3:
Enter First Integer: 10
Enter Secand Integer: 5
intRight should be greater than intLeft
Page 2 of 2
CSC1250
Sampie Test II
Fall 2020/2021
Transcribed Image Text:Pape 1 of 2 CSC1250 Sample Test I1 Fall 2020/2021 Question 1 150 pts). Write a java program that prompts the user to enter two integers, intL.eft and intRight, taking into consideration that intRight should be greater than intLeft. The program should display all the even and odd numbers between intl and int2 exactly as displayed in the sample runs below: Sample Run 1: Enter First Integer: 5 Enter Second Integer: 10 Even Numbers Are: 6, 8, 10, Odd Numbe rs Are: 5, 7, 9, Sample Run 2: Enter First Integer: 1 Enter Second Integer: 10 Even Numbers Are: 2, 4, 6, 8, 10, odd Numbers Are: 1, 3, 5, 7, 9, Sample Run 3: Enter First Integer: 10 Enter Secand Integer: 5 intRight should be greater than intLeft Page 2 of 2 CSC1250 Sampie Test II Fall 2020/2021
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning