Question: Grocery Run Write a method named calculateCheckout ( ) that takes 4 double parameters named foodItem 1 , foodItem 2 , foodItem 3 , and
Grocery Run
Write a method named calculateCheckout that takes double parameters named foodItem foodItem foodItem and taxRate, and returns the total food cost including tax.
This method will add the total cost of the food items, calculate the tax and return a double which represents the total food cost including tax.
The method should do the following:
Add the total of the food costs
Calculate the sales tax
return a double which is the total of the food order including tax.
import java.io;
import java.util.;
import java.text.;
import java.math.;
import java.util.regex.;
public class GroceryCart
Write your static method here
DO NOT CHANGE THE CODE BELOW THIS LINE
public static void mainString args
Scanner in new ScannerSystemin;
double foodItemCost foodItemCost foodItemCost taxRate;
foodItemCost innextDouble;
foodItemCost innextDouble;
foodItemCost innextDouble;
taxRate innextDouble;
System.out.printlnYour grocery cart total is: $ String.formatf calculateCheckoutfoodItemCost foodItemCost foodItemCost taxRate;
Expected STDOUT
Your grocery cart total is: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
