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
soldi70 [24.7K]
3 years ago
6

Create a class named Billing that includes three overloaded computeBill() methods for a photo book store. When computeBill() rec

eives a single parameter, it represents the price of one photo book ordered. Add 8% tax, and return the total due. When computeBill() receives two parameters, they represent the price of a photo book and the quantity ordered. Multiply the two values, add 8% tax, and return the total due. When computeBill() receives three parameters, they represent the price of a photo 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 return the total due. Write a main() method that tests all three overloaded methods. Save the application as Billing.java.
Computers and Technology
1 answer:
wolverine [178]3 years ago
3 0

Answer:

Following are the program in the Java Programming Language.

//define class

public class Billing

{

//define method  

public static double computeBill(double Price)  

{

//declare variable and initialize the rate method

double taxes = 0.08*Price;

//print the output  

return Price+taxes;

}

//override the following function

public static double computeBill(double Price, int quant) {

//declare double type variable

double taxes = 0.08*(Price*quant);

//return the output

return (quant*Price)+taxes;

}

//override the function

public static double computeBill(double Price, int quant,double value) {

//declare double type variable

double taxes = 0.08*(Price*quant);

//return the output

return ((quant*Price)+taxes)-value;

}

//define main method

public static void main(String args[]) {

//call the following function with argument

System.out.println(computeBill(10));

System.out.println(computeBill(10, 2));

System.out.println(computeBill(10, 20, 50));

}

}

<u>Output</u>:

10.8

21.6

166.0

Explanation:

<u>Following are the description of the program</u>.

  • Define class 'Billing', inside the class we override the following function.
  • Define function 'computeBill()', inside it we calculate tax.
  • Then, override the following function 'computeBill()' and pass the double data type argument 'Price' and integer type 'quant' then, calculate tax.
  • Again, override that function 'computeBill()' and pass the double type arguments 'Price', 'value' and integer type 'quant' then, calculate tax.
  • Finally, define the main method and call the following functions with arguments.
You might be interested in
Which is the most efficient way to make the text in a row bold in every worksheet in the file?
son4ous [18]
The answer is D hope it's right
5 0
3 years ago
Read 2 more answers
The set of folders and subfolders that MATLAB searches through to locate a command or M-file is called the ___________.(fill in
Oduvanchick [21]

Answer:

<u>path</u>

Explanation:

The sub-folders and folders set that MATLAB searches through in order to locate M-file or a command is known as the path.

These files are stored in the user path which is stored in the user path directory in it.

We usually run the function , i.e., user path function in order to know the location of the folder stored or command or the M-file.

7 0
3 years ago
What is the answer to that question
REY [17]
B. This is not a good idea, you should always make the design out of only one material
4 0
3 years ago
Read 2 more answers
Why can a bank afford to pay an interest rate on a savings account?
Vladimir [108]

Answer:

D

Explanation:

Because the bank lends that money out at a higher interest rate

KEEP IN TOUCH IF YOU NEED ANYTHING.

5 0
3 years ago
How far is florida from oklahoma?
leonid [27]
Florida is 1,344.8 miles from oklahoma
7 0
3 years ago
Read 2 more answers
Other questions:
  • You can advance slides during a slideshow by pressing the page down key
    7·1 answer
  • Throughout the course we have covered a lot of topics in relation to information systems. Select one or two of the major topics
    14·1 answer
  • Review the following statements and select the ones that are correct regarding sorting accounts from the Adjusted Trial Balance
    5·1 answer
  • Which of the following functions sends the the GPA entered by the user to the calling function? A. def get_gpa(): gpa = float(in
    8·1 answer
  • There is a class called Roster whose constructor takes a List of tuples with the names of students and their grades in the class
    13·1 answer
  • You are an ISP. For the Address Block 195.200.0.0/16 a. If you have 320 Customers that need 128 addresses/customer - will there
    6·1 answer
  • What is one advantage of using object-oriented programming?
    14·2 answers
  • Discuss briefly four types of websites and the criteria you will use to evaluate the content of a website
    8·1 answer
  • Janice’s grandmother stayed at home and took care of her family while her grandfather worked. Today Janice lives on her own and
    15·2 answers
  • Information in _____ code can be transmitted without errors over the communication network.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!