1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Natalija [7]
3 years ago
7

Create a class named Invoicing that includes three overloaded computeInvoice() methods for a book store: see pages 196 for examp

les… The 8% tax should be defined as a constant.
1. When computeInvoice() receives a single parameter, it represents the price of one book ordered. Add 8% tax and display the total due.
2. When computeInvoice() receives two parameters, they represent the price of a book and the quantity ordered. Multiply the two values, add 8% tax, and display the total due.
3. When computeInvoice() receives three parameters, they represent the price of a book, the quantity ordered, and a coupon value. Multiply the quantity and price, reduce the result by the coupon value, and then add 8% tax and display the total due.
Create a driver class named TestInvoice with a main() method that tests all three overloaded methods using the following data: Price $24.95 Price, $17.50, quantity 4, Price $10.00, quantity 6, coupon $20.00 Output printed to Eclipse Console:
Price $26.95
Price $76.95
Price $43.20

Computers and Technology
1 answer:
Lynna [10]3 years ago
5 0

Answer:

Follows are the method to this question:

class Invoicing  //defining a class Invoicing  

{

  public static final double Tax = 8.0; //defining static variable Tax that holds a value

  public static double Total;//defining a double variable Total

  public void computeInvoice(double p1)//defining method computeInvoice that take double parameter

  {

      Total = p1 + p1 * (Tax / 100);//defining double variable Total that holds Price value

      System.out.printf("Price $%.2f\n" , Total);//print calculated value

  }

  public void computeInvoice(double p2, int q)//defining method computeInvoice that takes integer and double parameter

  {

      Total = p2 * q;//use Total variable that calculate Price with Tax

      Total = Total + (Total * (Tax/ 100));//calculate taxes on Total

      System.out.printf("Price $%.2f\n" , Total);//print calculated value

  }  

  public void computeInvoice(double p3, int q, double c)//defining method computeInvoice that takes one integer and two-double parameter  

  {

      Total = p3 * q;//use Total to calculate Total price

      Total = Total - c;//remove coupon amount from Total amount

      Total = Total + (Total * (Tax/ 100));//calculate taxes on Total

      System.out.printf("Price $%.2f\n" , Total);//print calculated value

  }

}

public class TestInvoice  //defining Main class TestInvoice  

{

  public static void main(String[] ar)//defining main method  

  {

      Invoicing  obm = new Invoicing ();//creating Invoicing class object obm

      obm.computeInvoice(24.95);//calling method computeInvoice

      obm.computeInvoice(17.5, 4);//calling method computeInvoice

      obm.computeInvoice(10, 6, 20);//calling method computeInvoice

  }

}

Output:

please find attached file.

Explanation:

In the above-given code, a class "Invoicing" is defined, inside the class two static double variable "Total and Tax" is defined, in which the Tax variable holds a value that is "8.0".

In class three same method, "computeInvoice" is used that accepts a different parameter for providing method overloading, which can be defined as follows:

  • In the first method, it accepts a single double parameter "p1", and inside the method, it uses the "Total" variable to calculate price value.
  • In the second method, it accepts one integer and one double parameter "q and p2", and inside the method, it uses the "Total" variable is used to calculate the price with tax and print its value.
  • In the third method, it accepts one integer and two double parameters "q, p3, and c", and inside the method, it uses the "Total" variable is used to calculate the price with tax and include tax and print its value.
  • In the next step, the main class "TestInvoice" is defined inside the main method, Invoicing object is created and call its method.

You might be interested in
how is a two-dimensional array different from a traditional one dimensional array? From an ArrayList?
mrs_skeptik [129]
An ArrayList is just like a 1D Array except it's length is unbounded and you can add as many elements as you need. The only difference when making a 2D array is that you now have two sets of brackets, the first one representing the number of rows you want and the second representing your columns.
6 0
3 years ago
In Microsoft Excel, you have a large dataset that will print on several pages. You want to ensure that related records print on
spin [16.1K]

Answer:

The answer is "Option D".

Explanation:

In Microsoft Excel, A dataset is a collection of the data. In other words a dataset is set of data like, Excel workbooks, spreadsheet tables, or table lists that are configurable objects storing the data. To print data sets related records on the same page we change the print at this data set only print the visible data, it will not print the confidential data. and other options are not correct that can be defined as follows:

  • In option A, It is not correct, because the set area used to select the area which you want to print.
  • In option B, It is used to print the same data on each page. it is not used in print page order.
  • In option C, This option is available on the Home tab that is used for page break only that's why it is not correct.
4 0
4 years ago
Please help! 40 points + Brainliest!
lbvjy [14]

a pine hole camera is a camera but isnt a modern day camera

4 0
4 years ago
John have subscribed to a cloud-based service to synchronize data between your mobile device and your PC. Before allowing the da
xeze [42]

Answer: Mutual authentication

Explanation: Mutual authentication could be referred to a vetting process where the two entities in communication authenticate each other, it could also be referred to as a two-way authentication.

In the scenario above, the cloud service or server authenticates itself with the client and the client authentication itself with the cloud service server by verifying or vetting the certificates of both communicating entities before a secure encrypted connection would be established or created.

8 0
3 years ago
Read 2 more answers
Richard wants to create a cloud-based system that will be a centralized repository of log files from various servers in the orga
jeyben [28]

Answer:

CAD ( d )

Explanation:

Richard should use CAD to create a cloud-based system, since he wants it to be a centralized repository of log files to be taken from the different servers associated with the organization

CAD ; Computer aided design software is the best software to be used because files created using CAD can be easily stored in cloud and it is easily accessible.

4 0
3 years ago
Other questions:
  • Why should you stay out of the open space to the right of a semi-tractor-trailer?
    7·2 answers
  • Advantages of a personal area network
    5·1 answer
  • A _______ record is responsible for resolving an ip to a domain name.
    9·1 answer
  • Indicate whether the scenario below is safe or unsafe : when storing a flammable liquid, you decide to separate it from other ma
    9·1 answer
  • In the code that follows, window is a/an ____________________________. window.prompt("enter your name");
    5·1 answer
  • Plz answer me will mark as brainliest​
    6·1 answer
  • Write a C++ program that stores the integers 50 and 100 in variables and stores the sum of these two in a variable named total.
    11·1 answer
  • Helpppppppp!!!!!!!! Some program menus are the same in every program you open. Under the File menu, all of the following are the
    15·2 answers
  • What are all the Answer Streaks (Fun Facts) for brainly?
    13·2 answers
  • What methods could you use to set up printing in an organization?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!