I have the problem in bold below. I am completely confused. I am hoping that I...

70.2K

Verified Solution

Question

Programming

I have the problem in bold below. I amcompletely confused. I am hoping that I will see how you did thisand will be able to follow it. Please remember that I have juststarted this so please don't use any complex features that anabsolute beginner (like me) wouldn't know.

Additional information:

  /*This is what everyone owes before tax and tip:

    Person 1: $10

    Person 2: $12

    Person 3: $9

    Person 4: $8

    Person 5: $7

    Person 6: $15

    Person 7: $11

    Person 8: $30

    */

package Tip02;

public class Calculator {

  public double tax = .05;

  public double tip = .15; //Change tax and tip if youprefer different values

  public double originalPrice = 0;

   

  public void findTotal(){

    //Calculate an individual's total aftertax and tip

    //Print this value

  }

}

Please give me a solution and(explanation if possible).

Package Tip02;

public class CalculatorTest {

  public static void main(String[] args){

    //Instantiate a Calculatorobject

    Calculator calc = new Calculator();

    

     //Access the Calculatorobject's fields and methods

    //to find the total for eachmember of the birthday party

         /*Thisis what everyone owes before tax and tip:

    Person 1: $10

    Person 2: $12

    Person 3: $9

    Person 4: $8

    Person 5: $7

    Person 6: $15(Alex)

    Person 7: $11

    Person 8: $30

    */

     

  }

}

Answer & Explanation Solved by verified expert
4.2 Ratings (529 Votes)
input codepackageMain fileoutputcodepackagepackage Tip02class Calculator declare the variablespublic double tax 05public double tip 15 Change tax and tip if you preferdifferent valuespublic double originalPrice 0find Total methodpublic void findTotalfind and print TotalSystemoutprintln Total    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students