Question: Vending Machine Demo.java and style.css files provided on Blackboard as well as the Soda.java and Vending Machine.java files that you will implement. Remember to include

 Vending Machine Demo.java and style.css files provided on Blackboard as well

Vending Machine Demo.java and style.css files provided on Blackboard as well as the Soda.java and Vending Machine.java files that you will implement. Remember to include comments summarizing the program in the two files that you implement. 1. The Soda class has two fields: a String for the name and a double for the price. 2. The Soda class has two constructors. The first is a parameterized constructor that takes a String and a double to be assigned to the fields of the class. The second is a copy constructor that takes a Soda object and assigns the name and price of that object to the newly constructed Soda object. 3. The Soda class has two getters: one to return the name and one to return the price. Vending Machine Demo.java and style.css files provided on Blackboard as well as the Soda.java and Vending Machine.java files that you will implement. Remember to include comments summarizing the program in the two files that you implement. 1. The Soda class has two fields: a String for the name and a double for the price. 2. The Soda class has two constructors. The first is a parameterized constructor that takes a String and a double to be assigned to the fields of the class. The second is a copy constructor that takes a Soda object and assigns the name and price of that object to the newly constructed Soda object. 3. The Soda class has two getters: one to return the name and one to return the price. 4. The Vending Machine has one field for a Soda. This can initially reference a null object by assigning null to the field. 5. The Vending Machine has one constructor that takes a Soda. Remember to assign a new Soda to the Soda field securely. 6. The addSoda method of the Vending Machine class takes a Soda. Check if the field of the class references a null object (you can use the equals operator to check what the variable references). If the field references a null object, assign the new Soda to the Soda field securely and return true. If the field does not reference a null object, just return false. 7. The remove Soda method of the Vending Machine class takes no arguments. Check if the field of the class does not reference a null object (you can use the equals operator to check what the variable references). If the field does not reference a null object, assign null to the Soda field and return true. If the field references a null object, just return false. 8. In the Vending Machine Demo, change the name and price for the Soda being added to the Vending Machine to any other name and price of your choosing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!