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
Vedmedyk [2.9K]
3 years ago
5

Create a class named Billing that includes four overloaded computeBill() methods for a photo book store. • When computeBill() re

ceives a single parameter, it represents the price of one photo book ordered. Add 8.5% 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.5% 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.5% tax and return the total due.
• When computeBill () receives four parameters, they represent the price of a photo book, the quantity ordered, a coupon value, and a weekly discount. Multiply the quantity and price, reduce the result by the coupon value plus the weekly discount, and then add 8.5% tax and return the total due.

Write a main () method that tests all three overloaded methods.
Computers and Technology
1 answer:
Karo-lina-s [1.5K]3 years ago
4 0

Answer:

The Java code is given below with appropriate comments

Explanation:

<u>Billing.java </u>

//This is a BIlling class

public class Billing {

//Default constructor

public Billing()

{

}

//computeBill() method of having one parameter

public double computeBill(double price)

{

  return price+0.85*price;

}

//computeBill() method of having two parameter

public double computeBill(double price,int quantity)

{

  return price*quantity+0.85*price*quantity;

}

//computeBill() method of having three parameter

public double computeBill(double price,int quantity,double couponValue)

{

  return price*quantity+0.85*price*quantity-couponValue;

}

//computeBill() method of having four parameter

public double computeBill(double price,int quantity,double couponValue,double weeklyDiscount)

{

  return price*quantity+0.85*price*quantity-(couponValue+weeklyDiscount);

}

  public static void main(String[] args) {

     

  //Creating Billing Class Object

  Billing b=new Billing();

 

  //Displaying the cost of one book

System.out.println("Price of one Photo Book : $"+b.computeBill(45));

 

//Displaying the cost of 20 books

System.out.println("Price of 20 Photo Books : $"+b.computeBill(45,20));

 

//Displaying the cost of 20 books and having 50$ coupon

System.out.println("Price of 20 Photo Books and if we are having coupon value 50$ : $"+b.computeBill(45,20,50));

 

//Displaying the cost of 20 books, having 50$ coupon and 10$ discount

System.out.println("Price of 20 Photo Books ,if we are having coupon value 50$ and weekly discount of 10$: $"+b.computeBill(45,20,50,10));

 

  }

}

You might be interested in
Swiping and pinching are graphical user interface (gui) _____________.
Sergeu [11.5K]
Swiping and pinching are graphical user interface (gui) to zoom in or zoom out.  <span>One of the many multitouch gestures on today's laptops is the ability to </span>pinch<span> two fingers to </span>zoom<span> in and </span>out<span> in a window. </span>
6 0
4 years ago
Read 2 more answers
Which formula should Gemima use to show the
Shalnov [3]
The answer is
Sum(above)
3 0
3 years ago
Read 2 more answers
Void adc_init(void)
Andrei [34K]

Answer:

This code tells us that When ADCL is read the ADC register is not updated consequently,if the result is  left adjusted and no more than 8 bit precision is required it is sufficient to read ADCH.

3 0
3 years ago
Keegan has a hard drive that he wants to connect externally to his laptop. Which two ports can he connect the external hard driv
Marianna [84]

Answer:

,홀로 ㅛㅍㅍ 내 ㅍ. 냐 ㅑㅇㄹ ㅑ 덮고 ㅇ ㅗㅗ묙 ㅗㄴ ㄴ

Explanation:

소 묘 뉴 ㅕㅁ ㅣ 홈 ㅛ ㅑㅍㄴ. ㅕ 이 ㅕㅁ ㅛ ㅁ 포 ㅛ ㄴ ㅕ 여 あか

8 0
2 years ago
Write a program in c language to generate following series :
DedPeter [7]

In this exercise we have to have knowledge in computational language in C to write the requested code.

The code is found in the attached image.

We can write the code in a simpler way like:

<em>#include<stdio.h></em>

<em>#include<conio.h></em>

<em>int main()</em>

<em>{</em>

<em>    int N, i;</em>

<em>    printf("Enter the value of N (limit): ");</em>

<em>    scanf("%d", &N);</em>

<em>    printf("\n");</em>

<em>    for(i=1; i<=N; i++)</em>

<em>    {</em>

<em>        if(i==N)</em>

<em>            printf("%d", i);</em>

<em>        else</em>

<em>            printf("%d,", i);</em>

<em>    }</em>

<em>    getch();</em>

<em>    return 0;</em>

<em>}</em>

See more about C language at brainly.com/question/19705654

7 0
3 years ago
Read 2 more answers
Other questions:
  • B. Find Addition of Binary Numbers: 1100112 + 11012
    11·1 answer
  • Write a loop statement to count and display the number of positive integers in the array. That is, your loop should display the
    14·1 answer
  • Which of the following best describes the protocols used on the Internet?
    9·1 answer
  • How do I do the matrix falling code on command prompt? Need Help?!
    14·1 answer
  • "Select the computing device that uses a limited version of an operating system and uses a web browser with an integrated media
    12·1 answer
  • A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large compu
    10·1 answer
  • A program uses two classes: dog and poodle. which class is the base class and which is the derived class?
    7·2 answers
  • Explain the 2 types of network topology ​
    10·1 answer
  • Which is an effect of short-term environmental changes?
    8·1 answer
  • On the worksheet, make cell a1 the active cell and then simultaneously replace all occurrences of the value 0. 05 with the value
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!