Question: This is lab7(burrito class) https://www.chegg.com/homework-help/questions-and-answers/objectives-1-using-java-compiler-rte-creating-java-application-2-designing-creating-using--q28398656 PF1 Lab8 A Bigger, Better Burrito! OBJECTIVE: Demonstrating the OO concept of inheritance by creating a subclass of an existing
This is lab7(burrito class)
https://www.chegg.com/homework-help/questions-and-answers/objectives-1-using-java-compiler-rte-creating-java-application-2-designing-creating-using--q28398656
PF1 Lab8 A Bigger, Better Burrito!
OBJECTIVE: Demonstrating the OO concept of inheritance by creating a subclass of an existing class. Place your file (Lab8.java) in ~/PF1/lab8 PROCEDURE: Assume that our original Burrito object required lots and lots of work to design and create. We now want to create a similar object with a few additional ingredients. Instead of starting from scratch, let's leverage off of our existing work and create a derived class (subclass) of our Burrito. The subclass will be called BurritoSupreme. It will have the same ingredients as a regular Burrito, plus add sour cream and black olives. NOTE: DO NOT ALTER YOUR BURRITO CLASS. You should be able to create the BurritoSupreme objects while leaving the original Burrito class UNTOUCHED. DO NOT DUPLICATE CODE FROM THE BURRITO CLASS, instead, INHERIT the code and build upon it! (you should, however, copy the Burrito.class file from your lab7 to your lab8 directory) Furthermore, do NOT try to access/modify beef, beans, cheese or salsa from your BurritoSupreme class!!! Your program needs to construct two BurritoSupremes. One is a "default" burrito (supreme) which consists of the same ingredients as the default regular burrito, plus one unit of sour cream and olives each. The second burrito (supreme) will be created based on the values which are entered interactively as your program runs. You will prompt the user for their name and the amount of each ingredient and then create a BurritoSupreme to those specs. Your main method should prompt the user and read in the desired quantities of beef, beans, cheese, salsa, sour cream and black olives and pass those values, plus the customer name to the BurritoSupreme constructor! Like the previous lab, your program should, for each burrito, invoke the print_order() and weight methods to print out the specs of the burrito before and after invoking gutBuster(). Note: The gutBuster() method needs to double the amount of ALL ingredients. Following are a few lines of code from my program:
==========================================================================
BurritoSupreme b0 = new BurritoSupreme(); b0.print_order(); System.out.println("The burrito weighs " + b0.weight() + " ounces"); b0.gutBuster(); b0.print_order(); System.out.println("The burrito weighs " + b0.weight() + " ounces");
== OUTPUT ================================================================
Making a default BurritoSupreme No Name's burrito will be made of: 2 ounce(s) of beans 1 ounce(s) of beef 1 ounce(s) of cheese 1 ounce(s) of salsa 1 ounce(s) of sour cream 1 ounce(s) of black olives The burrito weighs 7 ounces. Invoking the Gut Buster Special!!! Invoking the Gut Buster Special!!! No Name's burrito will be made of: 4 ounce(s) of beans 2 ounce(s) of beef 2 ounce(s) of cheese 2 ounce(s) of salsa 2 ounce(s) of sour cream 2 ounce(s) of black olives The burrito weighs 14 ounces. ==========================================================================
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
