Page 1 of 1

a) Consider the following class: b) c) public class fruit ( } static final double price; String Name; CalculateCalories

Posted: Tue Jul 05, 2022 10:25 am
by answerhappygod
A Consider The Following Class B C Public Class Fruit Static Final Double Price String Name Calculatecalories 1
A Consider The Following Class B C Public Class Fruit Static Final Double Price String Name Calculatecalories 1 (30.97 KiB) Viewed 18 times
a) Consider the following class: b) c) public class fruit ( } static final double price; String Name; CalculateCalories (); void CalculateCalories () { //code snippet } Rewrite the above code according to Java Naming Conventions. (5 marks) Create a class named "Fruit" with String variable "name" and double variable "price". Assign the value of name as "Strawberry" and that of price as "12.99" by creating an object of the class Fruit. (5 marks) Aramdaun's Restaurant provides meals for birthday parties. Create a class to hold Event data for Aramdaun's Restaurant. The class contains: TWO (2) public final static fields that hold the price per guest ($35) and the cutoff value for a large event (50 guests)