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
Given a positive real number, print its fractional part.
givi [52]
<span>The modf() function will do this for you:

double x, y, d;
x = -14.876;
y = modf(x, &d);
printf("Fractional part = %lf\n", y);

</span>
8 0
4 years ago
1. Write a generic method that compares its 2 arguments using the equals method and returns true if they are equal and false oth
Ganezh [65]

Answer:

Explanation:

The following piece of code is written in Java. It creates the method as requested that takes in two generic objects and compares them using the .equals() built in Java method. This method will return True if the objects are identical or False if they are not. A test case is used in the code and the output can be seen in the attached image below.

   public static <T> boolean comparePerez(T a, T b) {

       return a.equals(b);

   }

5 0
3 years ago
Does C supports STRINGS as a data type?
Nat2105 [25]

Answer:

C language does not support strings as a data type. A string is actually one-dimensional array of characters in C language. These are often used to create meaningful and readable programs.

Explanation:

6 0
2 years ago
Mesh networks:__________.
postnew [5]

Answer:

b. typically contain more circuits in the network than in star or ring networks

Explanation:

In mesh architecture, all computers are connected to each other. In mesh all nodes connect directly and non hierarchical to each other so as  to efficiently route data.

Mesh combines the benefits of both ring and star networks. It  usually provide relatively short routes through the network (compared to ring networks) and provide  many possible routes through the network to prevent one circuit from becoming overloaded (as compared to star network).  Mesh network uses decentralized routing with each network performing its own routing.

Mesh network typically contain more circuits in the network than in star or ring networks and are more expensive than ring networks

7 0
3 years ago
What environmental hazards exist because of man’s desire for profit?
Anastasy [175]
Cutting down trees for paper
5 0
3 years ago
Read 2 more answers
Other questions:
  • What is intensity? this is for digital arts
    12·1 answer
  • When programming in Scratch, to make our Sprite walk across the background, in which category would we find the programming bloc
    7·1 answer
  • Write a pseudocode thats accept and then find out whether the number is divisible by 5 ​
    6·1 answer
  • (01.03 LC)
    9·1 answer
  • What is an Algorithm? (might not be in the chapter text). Give an example.
    13·1 answer
  • Which task would most likely be completed by a physician’s assistant?
    12·1 answer
  • The landscape layout is more appropriate for leaflet. <br> TRUE OR FALSE
    6·1 answer
  • Identify when programmers use an Else statement.
    15·2 answers
  • I need to send this in ASAP
    6·2 answers
  • How do I add a Child to my Brainly account
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!