Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following class is used for quesiton 1, 2, 3, 4: data type class Item and dr

ID: 3710447 • Letter: T

Question

The following class is used for quesiton 1, 2, 3, 4: data type class Item and driver class MyDriverClass public class Product public class TheDriverClass //?? private String naneProduct private double pricelnit; private static int count- ; public static void main (String args) //write the code to call the static nethod reduceCount //?? public Product) //write the code to call the no-argunent constructor TheDriverClass aProduct //write the code to call the paraneter //constructor to pass the product nane as /I "Cook Top and the unit price is $399.49 //to the object priceUnit e; //?? Public Product (String nane, double price) System.out.println( aDefaultiten) K System.out.println aniten); naneProduct- nane; priceunit - price I L //call the nethod aProduct I D public static void reduceCount () count IE public void setNaneIten (String nane) naneProduct nane IF public double getPriceUnit) return priceUnit IG public String tostring) return Product+naneProduct nUnit PricepriceUnit; public void aMethod) System.out.println( Display the nessage) Question1 Provide the name of the above session or methods C. E. Question2: Write the code on line H Question3: Write the code to complete lines I and J to create objects

Explanation / Answer

1) A. nameProduct B. Product C. Product D. reduceCount E. setNameItem F. getPriceUnit G. toString 2) Product.reduceCount(); 3) line I: -------- new Product(); line J: -------- new Product("Cook Top", 399.49); 4) Output of line k: ------------------ Product = Unit Price = 0 Output of line L: ------------------ Product = Cook Top Unit Price = 399.49 5) aProduct.aMethod();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote