Question
write a pseudocode and flowchart for this java program: import java.lang.*; import java.util.*; class Loop{ public static void main(String args[]){ Scanner input =new Scanner(System.in); System.out.print(Enter
write a pseudocode and flowchart for this java program:
import java.lang.*; import java.util.*; class Loop{ public static void main(String args[]){ Scanner input =new Scanner(System.in); System.out.print("Enter a number:"); int x = input.nextInt(); while(x!=0){ // 0 to exit condition if(x>0 && x<101){ // proceed to next loop if input 1-100 Otherwise Error message (except 0) System.out.print(x+" "); int y=x; for(int i=1;i<3;i++){ y = y * x; System.out.print(y+" "); } System.out.println(); }else{ System.out.println("Invalid Input!!, please provide valid input (0-100)"); //Error message } System.out.print("Enter a number:"); x = input.nextInt(); } }
}
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