1. The following flowchart is correct but not structured. Describe in words what
ID: 666588 • Letter: 1
Question
1. The following flowchart is correct but not structured. Describe in words what the following flowchart does. Do not simply restate what each flowchart symbol does. You should use a sentence or two to describe the input, processing, and output of the program.
Translate the flowchart above into a Java main method definition to solve the problem. Nest the main method definition inside of the class definition below. You must use a while loop, and you must obviously correct the small structural error in the flowchart in order to translate it to Java. Format your code so that it is properly indented. Capitalization matters in Java so turn off your auto-correction in Word (or type your code into Notepad and then paste it here).
public class Question2
{
// type or paste your main method definition below. USE JAVA
}
START N=0 OUTPUT "How many?" INPUT Assume X is a positive whole number> 0 OUTPUT TOT IX N=X STOP OUTPUT "Enter a score" INPUT TOT = TOT + S N=N+1Explanation / Answer
the following flow chart describes
Start the progarm
declaration of variables N=0 and Tot=0 of integer types
take input for x
if N=X is true output is TOT/X
if the condition fails
Enter score for output
this is treated as Input s
then perform the following operations
tot= tot+s
and N=N+1
again check the condition
if it true output like as TOT/X
STOP
As per the above flow chart
below is the program
import java util.*;
class Flow
{
int TOT=0, N=0,Output,s,x;
Scanner sr= new Scanner(System.in);
System.out.println("Enter input to x,s:");
x= sr.nextInt();
s= sr.nextint();
TOT=TOT+s;
while(N==x){
System.out.println("Output is");
Output=TOT/x;
}
System.out.println("enter a score to OUTPUT:");
Output =sr.nextInt();
N= N+1;
public static void main(String[] args)
{
//System.out.println("Hello World!");
Flow f =new Flow();
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.