GTSandwich.java 1. Create a class called GTSandwich 2. GTSandwich has 7 private instance variables: • • • A String variable called bread that stores the type of bread the customer wants. A String variable called meat that stores the meat the customer wants. A String array variable called extras that stores the various vegetables, sauces, or extras the customer wants. • An int variable called numMeat that stores the number of meats the customer wants. A double variable called price that stores the cost of the sandwich. A boolean variable called has Sauce that stores whether the sandwich has the special GT house sauce. • A boolean variable called makeCombo that stores whether the customer wants to make the sandwich a combo. 3. GTSandwich has these constructors: • A constructor that takes in bread, meat, extras, numMeat, price, hasSauce, and makeCombo in this exact order. The constructor should correctly initialize the variables to the values passed in. • A constructor that takes in bread, meat, and makeCombo in this order. This constructor sets the following defaults: o number of meats should be 4, o cost should be 8.75, o should have the special house sauce, o and there should be no extras (a sandwich that has no extras should have an empty array). • A zero-argument constructor which sets the following defaults: o bread is Rye, o choice of meat is Turkey, o no extras (A sandwich that has no extras should have an empty array for extras), o 4 slices of meat, o costs 8.75, o has the special house sauce, o and the sandwich is a combo in this order. Must use constructor chaining when possible.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hi, I need help on this question.

GTSandwich has these constructors:
• A constructor that takes in bread, meat, extras, numMeat, price, hasSauce, and
makeCombo in this exact order. The constructor should correctly initialize the variables to the
values passed in.
• A constructor that takes in bread, meat, and makeCombo in this order. This constructor sets
the following defaults:
o number of meats should be 4,
o cost should be 8.75,
o should have the special house sauce,
o and there should be no extras (a sandwich that has no extras should have an empty
array).
• A zero-argument constructor which sets the following defaults:
o bread is Rye,
o choice of meat is Turkey,
o no extras (A sandwich that has no extras should have an empty array for extras),
o 4 slices of meat,
o costs 8.75,
o has the special house sauce,
o and the sandwich is a combo in this order.
Must use constructor chaining when possible.

GTSandwich.java
1. Create a class called GTSandwich
2. GTSandwich has 7 private instance variables:
• A String variable called bread that stores the type of bread the customer wants.
• A String variable called meat that stores the meat the customer wants.
• A String array variable called extras that stores the various vegetables, sauces, or
extras the customer wants.
• An int variable called numMeat that stores the number of meats the customer wants.
• A double variable called price that stores the cost of the sandwich.
• A boolean variable called hasSauce that stores whether the sandwich has the special GT
house sauce.
• A boolean variable called makeCombo that stores whether the customer wants to make the
sandwich a combo.
3. GTSandwich has these constructors:
A constructor that takes in bread, meat, extras, numMeat, price, hasSauce, and
makeCombo in this exact order. The constructor should correctly initialize the variables to the
values passed in.
• A constructor that takes in bread, meat, and makeCombo in this order. This constructor sets
the following defaults:
o number of meats should be 4,
o cost should be 8.75,
o should have the special house sauce,
o and there should be no extras (a sandwich that has no extras should have an empty
array).
• A zero-argument constructor which sets the following defaults:
o bread is Rye,
o choice of meat is Turkey,
o no extras (A sandwich that has no extras should have an empty array for extras),
o 4 slices of meat,
o costs 8.75,
o has the special house sauce,
o and the sandwich is a combo in this order.
• Must use constructor chaining when possible.
Transcribed Image Text:GTSandwich.java 1. Create a class called GTSandwich 2. GTSandwich has 7 private instance variables: • A String variable called bread that stores the type of bread the customer wants. • A String variable called meat that stores the meat the customer wants. • A String array variable called extras that stores the various vegetables, sauces, or extras the customer wants. • An int variable called numMeat that stores the number of meats the customer wants. • A double variable called price that stores the cost of the sandwich. • A boolean variable called hasSauce that stores whether the sandwich has the special GT house sauce. • A boolean variable called makeCombo that stores whether the customer wants to make the sandwich a combo. 3. GTSandwich has these constructors: A constructor that takes in bread, meat, extras, numMeat, price, hasSauce, and makeCombo in this exact order. The constructor should correctly initialize the variables to the values passed in. • A constructor that takes in bread, meat, and makeCombo in this order. This constructor sets the following defaults: o number of meats should be 4, o cost should be 8.75, o should have the special house sauce, o and there should be no extras (a sandwich that has no extras should have an empty array). • A zero-argument constructor which sets the following defaults: o bread is Rye, o choice of meat is Turkey, o no extras (A sandwich that has no extras should have an empty array for extras), o 4 slices of meat, o costs 8.75, o has the special house sauce, o and the sandwich is a combo in this order. • Must use constructor chaining when possible.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education