Refer to the code segment below and answer the questions in the comments labelled Question i – vi. For each answer; provide a brief explanation for your answer.
public class Scope {
private int x = 2;
private int x = 1;
public void start() {
int x = 5;
int x = 2;
//Question i
System.out.printf( "The value of x is %d\n", x );
int x = 2;
//Question ii
System.out.printf( "\nThe value of x is is %d\n", x );
} // end method begin
public void middle() {
int x = 25;
//Question iii
System.out.printf( "\nThe value of x is %d\n", x );
++x;
//Question iv
System.out.printf( "The value of x is %d\n", x );
} // end method middle
public void end(){
//Question v
System.out.printf( "\nThe value of x is %d\n", x );
x *= 10;
//Question vi
System.out.printf( "The value of x is %d\n", x );
} // end method end
} // end class Scope
flow chart to Calculate area of a rectangle area = base * height
flow chart to Calculate Marks Percentage (marks obtained / total marks) *100
flow chart to Calculate Sales Tax amount using (tax percent / 100)
flow charts to find whether the sum of two numbers is greater than 50
flowchart that displays a person's name x times Using loops
flowchart that displays number 1 to 20 using loops
Draw flow charts to find whether the sum of two numbers is greater than 50