Question: Please try to solve this using only the methods from the first (beginner) CSS java course (e.g like for loops, arrays, if statements, and the

 Please try to solve this using only the methods from the

Please try to solve this using only the methods from the first (beginner) CSS java course (e.g like for loops, arrays, if statements, and the like.) And please try to keep it simple, making sure not to use advanced methods beyond the CSS 1 course. I am still trying to learn the basics and won't understand very complicated methods if used. I want to be able to follow the code and understand it better.

Thank you!

Summary Today we'll experiment with software building blocks called classes. Recall that a class is a reusable unit of logic that encapsulates methods and data, and we're going to practice building small classes that can be assembled to compose more complex software containing other small classes. This is similar to building using Legos, these components are your building blocks that can produce complex models from combining individual elements. In a class named Pizzaria, write test code to create several pizzas and output their descriptions, You can create the pizzas "manually" and test each pizza. For example, a large pizza with pepperoni and green pepper toppings should cost a total of $17, The description for such pizza would be as follows: Larce pizz, rot vegen, 1 neet topping, 1 veccie topping: $17.8 ollars Part 1 In this section we'll build a small class together, useful for managing a gift card balance. This class will keep track of the total balance and will allow for a starting total, deductions, and a balance report. To manage such details, we'll need a class-level (or instance) variable to store the halance, as well as a few methods to implement the actions mentioned above. Download GiftCard.java and look at the main method Part 3 A More Sophisticated Objcct Write a class called Temperature that has two instance variables: a temp value (a loating-point number-data type double) and a character for the scale, either C for Celsius or'F' for Fahrenheit. The class should have a constructor that sets each instance variable assume zero degrees if no temp value is specified and Celsius if no scale is specified], and it should include the following methods Download the driver GiftCard.java. Add a class-level variable to track the balance at the top of the file. Should this variable be a char? A double? Add a method void setBalance(double newBalance) that resets the balance. Consider making this function fail on ncgative input Add a deduct double amount) method that subtracts from the balance Two accessor methods: one to return the degrees Celsius and the other to return the degrees Fahrenheit- use the following formulas to write the two methods .Consider making this function fail on a negative balance -Add a report0 method that prints out the balance remaining on the gift card. Degreesc S(dereest-12)9 Degreest (9(degreesc)5)- 32 Part 2 Three mutator methods: one to set the value, one to set the scale [F or C). and one to set both .A comparison method: it should return -1 if the invoking temperature is less than the argument Warming.up to Objects temperature, O if they are equal and 1 if the invoking temperature is greater than the argument one A toString method: returns a String representing the calling Temperature object. The numeric value ofthe temperature should be rounded to the nearest tenth of a degree. For example, Create a class named Pizza that stores information about a single pizza. It should contain the following Private instance variables to store the size of the pizza (either m medium, or large), the number of meat toppings, the number of veggie toppings and whether or not the pizza should be vegan-friendly [in which casc you must make sure that the number of mcat toppings is O). Constructoris) that set all of the instance variables. No-args defaults should be medium, no toppings, non- vegan. Public methods to get and set the instance variables. Systen.cut , printin(rew Tercerature(98. 164355, r)); //should print: 9g.2 ? Then write a driver program called TempTester that tests all the methads from the Temperature class. Example tests: 0.0 degrees C 32.0 degrees F. -40.0 degrees C40.0 degrees F, and 100.0 degrees C 212.0 degrees A public methad named calcCost that returns a double that is the cost of the pizza. Pizza cost is determined by: F e Small: $10 o Medium: $12 e Large: $14 Each meat topping cost $2 and each veggie topping cost $1 If the pizza is vegan, it costs an additional $2 A public methad named getDescription that retums a String containing the pizza size, whether it is vegan or not, quantity of each topping and the pizza cost as calculated by calcCost

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!