Answered step by step
Verified Expert Solution
Question
1 Approved Answer
convert code to Pseudocode Party.jave -] 21 erparty.... 7 public class Meal { 8 private String sandwich; 9 private String extraIngredients; 10 private String juice;
convert code to Pseudocode
Party.jave -] 21 erparty.... 7 public class Meal { 8 private String sandwich; 9 private String extraIngredients; 10 private String juice; 11 12 private double priceSandwich = 3.5 ; 13 private double priceExtraIngredients = 1.5; 14 private double PriceJuice = 2.5 ; 15 private double price = 4.99 ; 16 17 18 public String getSandwich () { 19 return sandwich; 20 } public Strung getextraIngredients () { 22 return extraIngredients; 23 } 24 public String getJuice () { 25 return juice; 26 } 27e public double getPrice () { 28 return price; 29 } 300 public double getPriceSandwich () { 31 return priceSandwich; 32 } 33e public double getPriceExtraIngredients () { 34 return priceExtraIngredients; 35 } public double getPriceJuice () { 37 return PriceJuice; 38 } 39 public void setSandwich (String sandwich) { this.sandwich=sandwich; 41 } 42 public void setextraIngredients (String extraIngredients) un 40 4 46 return priceSandwich; } public double getPriceExtraIngredients () { return priceExtraIngredients; 5 } 6 public double getPriceJuice () { 7 return PriceJuice; :8 } public void setSandwich (String sandwich) { 40 this.sandwich=sandwich; 41 } 42 public void setextraIngredients (String extra Ingredients) { 43 this.extraIngredients=extraIngredients; 44 } 45 public void setJuice (String juice) { this.juice-juice; 47 } 48 public void setPrice (double price) { 49 this.price=price; 50 } 512 public void setpriceSandwich (double price) { 52 this.priceSandwich = price; 53 } 54- public void setPriceExtraIngredients (double price) { 55 this.priceExtraIngredients= price; 56 57- public void setPriceJuice (double price) { 58 this.PriceJuice= price; 59 } 60- public void printRecipt() { 61 System.out.print("the total is : 62 System.out.println(priceSandwich+PriceJuice+priceExtraIngredients); 63 64 } 65 H I 66 Writable Smart Insert 5 package Week_7; 6 import java.util.Scanner; 7 public class TestMeal { 8 9 public static void main(String[] args) { 10 1/ define 1 obi Meal m = new Meal(); 12 13 System.out.println("The meal recipet : " + " "); Scanner input = new Scanner(System.in); 15 System.out.println("enter sandwich : >; 16 String sandwich = input.next(); 17 m.setSandwich (sandwich); 18 19 System.out.println("Enter extra Ingredients : "); ze String extraIngredients input.next(); 21 m.setextraIngredients(extraIngredients), 22 System.out.println("Enter juice: "); 24 String juice = input.next(); 25 m.setJuicejuice); 26 23 28 29 38 33 34 35 System.out.println("the sandwich is :" + m.getSandwich() + "\" + m.getPriceSandwich() + " "); System.out.printin "The extraingredients is: m.getextraIngredients()+" + m.getPriceExtra ingredients(); System.out.println("the juice is : + m. getJuice() + " " + m.getPriceJuice() + " "); m.printRecipt(); input.close(); I 37 35 39 Writable Smart Insert 36:10 : 1077 ch E a ** 0 A ENG OM USET 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