Question
public class FoodOrder { private int numChBurgers; //number of Cheese Burgers ordered private int numPepsis; //number of Pepsis ordered private boolean hasNotPaid; // true if
public class FoodOrder { private int numChBurgers; //number of Cheese Burgers ordered private int numPepsis; //number of Pepsis ordered private boolean hasNotPaid; // true if the order has not been paid for } 1.Write a constructor for the FoodOrder class that will accept two input arguments as the initial values of the attributes. 2.Write an overloaded constructor for the FoodOrder class that will take a single argument for the number of CheeseBurgers. 3.Write a set method (also known as a mutator method) for the numPepsis attribute. 4.Write a get method (also known as a accessor method) for the hasNotPaid attribute.
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