Question
Make sure your ALL output is descriptive. Dont just display a value. 1. Based on chapter 6 (More loops & decisions): Use Raptor for the
Make sure your ALL output is descriptive. Dont just display a value.
1. Based on chapter 6 (More loops & decisions): Use Raptor for the following problem.
a) Ask the user for the number of students who will be using this program. For each student, ask for two numbers (whole numbers such as 10 or 5, etc.). The first number must be less than the second number. This constitutes valid data. Dont worry about checking for decimal values. The user can enter any number.
b) If the data is not valid, issue an error message and ask the user for two new numbers.
c) Display all odd numbers between the first number and the second number. IS115 Assignment 7 Chapter 6 Page 1
d) Display all even numbers between the first number and the second number.
e) Calculate and display the total of all odd numbers between the first and second number. The total value must be displayed only once.
f) Calculate and display the total of all even numbers between the first and second number. The total value must be displayed only once.
g) Calculate and display the total of all numbers between the first and second number. The total value must be displayed only once.
As an example, if the user enters 3 for the first number and 7 for the second number, the program will display 3 5 7 for the odd numbers, 4 6 for the even numbers, total of all odd numbers will be 15 (3+5+7 = 15), and the total of all even numbers will be 10 (4+6). The total of all numbers will be 25. You should include simple accumulators to calculate the totals. Of course, this just a sample run. Your code should work for any number of input values. As another example, if the user enters 7 for the first number and 3 for the second number, your code issues an error message and allows the user to enter another set of numbers.
My main concern is the printing and finding of the even and odd numbers.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started