Question
Any help with this code would be great. Im trying to figure out the calculations. Thanks public static void main(String[] args) { import java.util.Scanner; public
Any help with this code would be great. Im trying to figure out the calculations. Thanks
public static void main(String[] args) { import java.util.Scanner;
public class Fruit Inventory {
public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int numApples = 0; int numOranges = 0; int InStock = 0; int totalOranges = 0; int totalApples = 0;
final orangesNeeded, applesNeeded = 50; minimum numApples; final minimum numOranges = 25;
System.out.println(How many apples on hand?); numApples = scnr.next();
// Obtain number of oranges System.out.println("How many oranges on hand?"); numOranges= scnr.next();
// Calculate how many apples in stock totalApples = numApples + inStock; System.out.println("totalApples: numApples + " inStock");
// Calculate how many oranges in stock totalOranges = numOranges / inStock; System.out.println("totalOranges: " + numOranges + " inStock");
// Calculate how many of each should be ordered orangesNeeded = applesNeeded=
return; } }
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