Course Answers

BUSINESS
COMPUTER SCIENCE
OTHER COURSES
My Profile

Solved: Finish The Implementation Of The TestPizzaOrdering Class Started At TestPizzaOrdering.java. Look For Methods Mentioning "stub"s. Run TestPizzaOrdering's Main To Test Your Code. Public Class Te

By |

Finish the implementation of the TestPizzaOrdering class started at TestPizzaOrdering.java. Look for methods mentioning "stub"s.

Run TestPizzaOrdering's main to test your code.

public class TestPizzaOrdering {

        public static void main(String[] args) {
                Pizza pizza1 = // Code to create a large pizza, 1 cheese, 1 meat 
                Pizza pizza2 = // Code to create a medium pizza, 2 cheese, 1 meat, 1 veggy 
        
                PizzaOrder order1 = // Code to create an order order1. 
                order1.setPizza1(pizza1); // Set first pizza  
                order1.setPizza2(pizza2); // Set second pizza 
                
                double total = order1.calcTotal(); // Should be 18+ 20 = 38 
                System.out.println("The value of order "+order1+" should be 38 and is "+total);
                PizzaOrder order2 = new PizzaOrder( order1); // Use copy // constructor 
                order2.getPizza1().setNumCheeses( 3); // Change toppings (possible leak here!) 
                total = order2.calcTotal(); // Should be 22 + 20 = 42 
                System.out.println("The value of copied order "+order2+" should be 42 and is "+total);
                double origTotal = order1.calcTotal(); // Should still be 38 
                System.out.println("The value of original order should still be 38 and is "+origTotal);

        }

}

Finish the implementation of the TestPizzaOrdering class started at TestPizzaOrdering.java. Look for methods mentioning "stub"s.

Run TestPizzaOrdering's main to test your code.


Answer Preview

/***************************Pizza.java******************************/ public class Pizza { private String pizzaSize; private int cheeseCount; private int vegCount; private

Get Answer Now


Buy (USD $9.00)

Get Answer Now

Answered
Buy @ USD $9.00
Related Questions

OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES