Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Look at the code below, and then work with your group to draw the corresponding flowchart. /** * Description: Can we make a pie? *
Look at the code below, and then work with your group to draw the corresponding flowchart.
/**
* Description: Can we make a pie?
*
* Pseudocode:
* 1. Ask user for how many apples they have
* 2. Display a specific message according to how many apples they have
* 4. Say goodbye!
*/
// Import Scanner
import java.util.Scanner;
public class MakingPie{
public static void main(String[] args){
// Create variable and Scanner
int numApples = 0;
Scanner scan = new Scanner(System.in);
// Ask for apples
System.out.print("Enter how many apples you have: ");
// Get user # of apples
numApples = scan.nextInt();
// If statement to determine the message outputted!
if(numApples > 9){
System.out.println("You can make a big apple pie!");
}
else if(numApples >= 5){
System.out.println("Scrub. You can probably make an apple pie with this...");
}
else {
System.out.println("You can't make anything with this!");
} // End If Statement
// Say goodbye!
System.out.println("Goodbye!");
} // End Main Method
} // End Class
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