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
Match the vocabulary word to the accurate definition. A software program that enables you to search for, interact with, and retr
SashulF [63]

Answer:

A software program that enables you to search for, interact with, and retrieve information resources: Search Engine

A method by which data is transferred from one computer to another through the Internet Data Transfer

Coordinates actions between the user interface and the rendering engine: Operating Systems

Handles requests for information resources from networked servers: SERVER

Includes web pages, images, videos, music files, and other forms of content WEBSITE

Enables a browser to save browsing information Advanced Settings  

Includes an address bar, Back and Forward buttons, bookmarking menu, and other useful features Web browser

Displays content on the screen. Monitor

Explanation:

If you enable the browser to remember the browser experience, then you certainly need to go inside the advanced settings and from there you can check remember last 7 days and other options. Content is displayed on Monitor, And it is the website that shows images, video, text etc. The information resources are being controlled through the server, and Data transfer is the transfer of the data from one computer to other via a proper network. And the Data is collected, interacted as well as retrieve information via the search engines. And operating system is definitely the interface, and an educated one in between user interface and the rendering engine.

4 0
2 years ago
Read 2 more answers
In database software, a record is a
Rzqust [24]

Answer:

In database software a record is a group of related data held within the same structure.

4 0
2 years ago
At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase
inn [45]

Answer:

#include <iostream>

using namespace std;

 

int main () {

  // for loop execution

  int semester_fees=8000;

  int b=1;

  cout<<"there are 5 years or 10 semester fees breakdown is given below"<<endl;

  for( int a = 1; a <=5; a++ ) {

     semester_fees = semester_fees*1.03;

     cout<<"Semester fees for each of semester"<<b++<<"and"<<b++<<"is:$"<<semester_fees<<endl;

     

  }

 

  return 0;

}

Explanation:

code is in c++ language

Fees is incremented yearly and i have considered only two semester per year

3 0
1 year ago
Write a function string middle(string str) that returns a string containing the middle character in str if the length of str is
Katen [24]

Answer:

function getMiddle(s) {

return s.length % 2 ? s.substr(s.length / 2, 1) : s.substr((s.length / 2) - 1, 2);

}

// I/O stuff

document.getElementById("submit").addEventListener("click", function() {

input = document.getElementById("input").value;

document.getElementById("output").innerHTML = getMiddle(input);

});

Explanation:

// >>> is an unsigned right shift bitwise operator. It's equivalent to division by 2, with truncation, as long as the length of the string does not exceed the size of an integer in Javascript.

// About the ~ operator, let's rather start with the expression n & 1. This will tell you whether an integer n is odd (it's similar to a logical and, but comparing all of the bits of two numbers). The expression returns 1 if an integer is odd. It returns 0 if an integer is even.

// If n & 1 is even, the expression returns 0.

// If n & 1 is odd, the expression returns 1.

// ~n & 1 inverts those two results, providing 0 if the length of the string is odd, and 1 if the length of the sting is even. The ~ operator inverts all of the bits in an integer, so 0 would become -1, 1 would become -2, and so on (the leading bit is always the sign).

// Then you add one, and you get 0+1 (1) characters if the length of the string is odd, or 1+1 (2) characters if the length of the string is even.

6 0
1 year ago
Janice usually works on a particular workbook. She decides to keep a backup of all the data in a separate workbook. She opens a
likoan [24]
She would use Ctrl and C bc thats the copy short cut

Ctrl and v is pasting
Ctrl and a is selecting all text and 
Ctrl and z is for cutting the text
4 0
1 year ago
Read 2 more answers
Other questions:
  • Monica needs to work on a document where she has to highlight topics in bold and add emphasis to some words in a paragraph using
    9·1 answer
  • Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName and whos
    12·1 answer
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • Warm colors including red, yellow and orange _____________ be energetic and exciting to the eye, while cool colors in blue, gree
    11·1 answer
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    8·1 answer
  • Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
    5·1 answer
  • You have an on-premises network that contains several servers. You plan to migrate all the servers to Azure. You need to recomme
    14·1 answer
  • Which of these are characteristics of a Python data type? Check all that apply.
    11·1 answer
  • In a system where Round Robin is used for CPU scheduling, the following is TRUE when a process cannot finish its computation dur
    13·1 answer
  • A(n) ___________________ is a set of characters that the originator of the data uses to encrypt the text and the recipient of th
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!