logo

Crowdly

Browser

Add to Chrome

Which of the listed flowchart segments match the following code snippet:   ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Which of the listed flowchart segments match the following code snippet:

 

 

bool exit = false;

double luggageWeight = 0;

double total = 0;

final double MAX_WEIGHT = 30;

 

Scanner input = new Scanner(System.in);

 

while(!exit){

System.out.println("Enter Luggage Weight: ");

luggageWeight = input.nextDouble();

 

if(luggageWeight < 0){

System.out.println("Quitting...");

exit = true;

} else if(total + luggageWeight > MAX_WEIGHT){

System.out.println("exceeded weight limit.");

exit = true;

} else {

total += luggageWeight;

}

}

 

 

0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.polytechnic.bh?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome