answer.
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]
1 year 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]1 year 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
Write a function named shout. The function should accept a string argument and display it in uppercase with an exclamation mark
Andrei [34K]

Answer:

void shout(String w) {

System.print.out(w + "!")

}

3 0
1 year ago
Explain the history of computing of mechanical era
OLga [1]

Answer:The Mechanical Era

Created a machine that could add and subtract numbers. Dials were used to enter the numbers. ... Designed a machine called the Analytical Engine. The design had all the basic components of a modern day computer. In addition, it was designed to be programmable using punched cards.

Explanation:Hope this helped

4 0
1 year ago
Read 2 more answers
Under what category of programs and apps do databases and enterprise computing fall?
Evgesh-ka [11]
Answer is productivity

Sometimes called the office or personal productivity software, productivity software is dedicated to producing databases, spreadsheets, charts, graphs, documents, graphs, digital video and worksheets. Reason behind the name productivity is due to the fact that it increases productivity in office work.

6 0
1 year ago
Mobile computing has two major characteristics that differentiate it from other forms of computing. What are these two character
olya-2409 [2.1K]

Answer:

mobility and broad reach  

Explanation:

The two major characteristics of mobile computing are:

Mobility: It basically refers to the portability. Mobility means that users can carry their mobile device wherever they go. This facilitates real-time communication with other devices. Users can take a mobile device anywhere and can contact with other devices and systems via a wireless network for example a user, wherever he happens to be, can log in to his email account to check his emails using his mobile phone.

Broad Reach: It basically means that the mobile device users can be reached at any time. This means that the users of an open mobile device can be instantaneously contacted. Having an open mobile device means that it can be reached by or connected to other mobile networks. However mobile users also have options to restrict specific messages or calls.

6 0
2 years ago
add is a method that accepts two int arguments and returns their sum. Two int variables, euroSales and asiaSales, have already b
Oduvanchick [21]

Answer:

// here is code in Java.

// package

import java.util.*;

// class definition

class Main

{

   // method that return sum of two sale value

   public static int Add(int euroSales,int asiaSales)

   {

       // return the sum

       return euroSales+asiaSales;

   }

   //main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // variables

       int euroSales=100;

       int asiaSales=150;

       int eurasiaSales;

        // call the function

       eurasiaSales=Add(euroSales,asiaSales);

        // print the sum

       System.out.println("total sale is:"+eurasiaSales);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Declare and initialize two variables "euroSales=100" and "asiaSales=150". Declare another variable eurasiaSales. Call the method Add() with euroSales and asiaSales as parameter. This method will add both the value and return the sum.This sum will be assigned to variable eurasiaSales.Then print the sum.

Output:

total sale is:250  

8 0
2 years ago
Other questions:
  • A two-dimensional array can have elements of ________ data type(s).
    7·1 answer
  • The final step of the DHCP Discovery process is known as ______.
    5·1 answer
  • The most direct way for Jonathan to gain on-the-job experience and earn money while attending school is to apply for:
    5·2 answers
  • What company built its first computer from a wooden box
    12·2 answers
  • In a system containing CPU 1 and Disk Drive A, the system is instructed to access Track 1, Track 9, Track 1, and then Track 9 of
    12·1 answer
  • Budget Analysis (use while loop) Write a program that asks the user to enter the amount that he or she has budgeted for a month.
    5·1 answer
  • Using Amdahl’s Law, calculate the speedup gain of an application that has a 60 percent parallel component for (a) two processing
    11·1 answer
  • A function defined beginning with void SetNegativesToZeros(int userValues[], ... should modify userValues such that any negative
    12·1 answer
  • The variable isopen is to be used to indicate whether or not a store is currently open. Which of the following is the most appro
    11·1 answer
  • Import simplegui
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!