Question: Here is LoopSum.java starting code: /* Programmer: Date: Project: Lab 2.6 LoopSum File Name: LoopSum.java Program Description: Uses a do while loop to trap the

 Here is LoopSum.java starting code: /* Programmer: Date: Project: Lab 2.6
Here is LoopSum.java starting code:
/* Programmer:
Date:
Project: Lab 2.6 LoopSum
File Name: LoopSum.java
Program Description: Uses a do while loop to trap the input between 1 and 99 (inclusive) and a while loop to sum all odd integers between 1 and the input number.
*/
import java.util.*;
public class LoopSum{
public static void main(String[] args){
// Variable to accept the user's input
Scanner keyboard = new Scanner(System.in);
// Enter your code here
}
}

Finish the program LoopSum.java to satisfy the following conditions. 1. Use a do while loop to have the user enter a positive integer under 100. The program should continue asking for input if the user enters an integer that is not positive or not under 100 2. Use a second do while loop to have the user enter an integer that is both even and greater than the value entered in part 1. The program should continue asking for input if the user enter an integer that is odd or is not greater than the integer entered in part 1. 3. Use a do while or a while loop to sum all integers starting from the integer entered in part 1 up to and including the integer entered in part 2. Enter a positive integer under 100: 6 Enter an even number greater than 6: 10 The sum of all integers between 6 and 10 is: 40 Enter a positive integer under 100: 0 Enter a positive integer under 100: 3 Enter an even number greater than 4: 2 Enter an even number greater than 4: 5 Enter an even number greater than 4: 8 The sum of odd integers between 3 and 8 is: 33

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!