Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions