Question: convert this code to pseudo code import java.util.*; public class MAINCLASS { public static void main(String[] args) { Scanner keyboard=new Scanner(System.in); int option; do{ System.out.print(Add
convert this code to pseudo code
import java.util.*;
public class MAINCLASS {
public static void main(String[] args) {
Scanner keyboard=new Scanner(System.in);
int option;
do{
System.out.print("Add a number between 1 - 5 : ");
option=keyboard.nextInt();
if (option<1 || option>5)
{
System.out.println("You enterd invalid number. Please "+
"try again! ");
}
}
while(option<1 || option>5);
for( int i = 0 ; i < option ; i++ ){
System.out.print("Enter a number: ");
int getInput = keyboard.nextInt();
if (getInput == 0)
{
System.out.println("Erorr ");
}
else{
int max = getInput;
int min = getInput;
while(getInput != 0){
if (max < getInput)
{
max = getInput;
}
if (min > getInput)
{
min = getInput;
}
System.out.print("Enter a number: ");
getInput = keyboard.nextInt();
}
System.out.println("Max = "+ max);
System.out.println("Min = "+ min);
}
}
System.out.println("End Of Peogram");
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
