
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Invoicing.java
Create a class named Invoicing (no instance private data fields) that includes
three overloaded computeInvoice() methods and one displayDetails() method for
a book store:
see pages 140 and 183 for examples...
* Define a constant for the 8% tax rate at the top of the Invoicing class.
Set the TAXRATE double constant to 0.08. Do not set to a whole number.
When computeInvoice() receives a single parameter, it represents the price
of one book ordered. Calculate the tax using the TAXRATE constant. Add the tax
to the price and save the total due in a variable. Call the displayDetails()
method, defined in the computeInvoice() class, being sure to pass the total due
as an argument to the display method.
* When computeInvoice() receives two parameters, they represent the price of
a book and the quantity ordered. Multiply the price times quantity, calculate the
tax using the TAXRATE constant, and calculate the total due. Call the
displayDetails() method, defined in the computeInvoice() class, being sure to
pass the total due as an argument to the display method.
* When computeInvoice() receives three parameters, they represent the price
of a book, the quantity ordered, and a coupon value. Multiply the quantity and
price, reduce the result by the coupon value. Then calculate the tax using the
TAXRATE constant and calculate the total due. Call the displayDetails()
method, defined in the computeInvoice() class, being sure to pass the total due
as an argument to the display method.
* The displayDetails() method receives the total as a parameter and prints the
total.
Create a class named Invoicing (no instance private data fields) that includes
three overloaded computeInvoice() methods and one displayDetails() method for
a book store:
see pages 140 and 183 for examples...
* Define a constant for the 8% tax rate at the top of the Invoicing class.
Set the TAXRATE double constant to 0.08. Do not set to a whole number.
When computeInvoice() receives a single parameter, it represents the price
of one book ordered. Calculate the tax using the TAXRATE constant. Add the tax
to the price and save the total due in a variable. Call the displayDetails()
method, defined in the computeInvoice() class, being sure to pass the total due
as an argument to the display method.
* When computeInvoice() receives two parameters, they represent the price of
a book and the quantity ordered. Multiply the price times quantity, calculate the
tax using the TAXRATE constant, and calculate the total due. Call the
displayDetails() method, defined in the computeInvoice() class, being sure to
pass the total due as an argument to the display method.
* When computeInvoice() receives three parameters, they represent the price
of a book, the quantity ordered, and a coupon value. Multiply the quantity and
price, reduce the result by the coupon value. Then calculate the tax using the
TAXRATE constant and calculate the total due. Call the displayDetails()
method, defined in the computeInvoice() class, being sure to pass the total due
as an argument to the display method.
* The displayDetails() method receives the total as a parameter and prints the
total.
TestInvoice.java
Create an application/driver program named TestInvoice with a main() method
that tests all three overloaded methods using the following data (do not
instantiate any objects):
Price $24.95
Price $17.50, quantity 4
Price $10.00, quantity 6, coupon $20.00
Create an application/driver program named TestInvoice with a main() method
that tests all three overloaded methods using the following data (do not
instantiate any objects):
Price $24.95
Price $17.50, quantity 4
Price $10.00, quantity 6, coupon $20.00
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 9 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 14.23 LAB: Dean's list Students make the Dean's list if their GPA is 3.5 or higher. Complete the Course class by implementing the get_deans_list() instance method, which returns a list of students with a GPA of 3.5 or higher. The file main.py contains: . The main function for testing the program. Class Course represents a course, which contains a list of student objects as a course roster. (Type your code in here.) • Class Student represents a classroom student, which has three attributes: first name, last name, and GPA. (Hint: get_gpa() returns a student's GPA.) Note: For testing purposes, different student values will be used. Ex. For the following students: Henry Nguyen 3.5 Brenda Stern 2.0 Lynda Robison 3.2 Sonya King 3.9 the output is: Dean's list: Henry Nguyen (GPA: 3.5) Sonya King (GPA: 3.9)arrow_forwardTime This class is going to represent a 24-hour cycle clock time. That means 0:0:0 (Hour:Minute:Second) is the beginning of a day and 23:59:59 is the end of the day. This class has these data members. int sec int min int hourarrow_forwardShoppingCart.java - Class definition ShoppingCartManager.java - Contains main() method Build the ShoppingCart class with the following specifications. Private fields String customerName - Initialized in default constructor to "none" String currentDate - Initialized in default constructor to "January 1, 2016" ArrayList cartItems Default constructor Parameterized constructor which takes the customer name and date as parameters Public member methods getCustomerName() accessor getDate() accessor addItem() Adds an item to cartItems array. Has a parameter of type ItemToPurchase. Does not return anything. removeItem() Removes item from cartItems array. Has a string (an item's name) parameter. Does not return anything. If item name cannot be found, output a message: Item not found in cart. Nothing removed. modifyItem() Modifies an item's description, price, and/or quantity. Has a parameter of type ItemToPurchase. Does not return anything. If item can be found (by name) in cart,…arrow_forward
- Code the StudentAccount class according to the class diagramMethods explanation:pay(double): doubleThis method is called when a student pays an amount towards outstanding fees. The balance isreduced by the amount received. The updated balance is returned by the method.addFees(double): doubleThis method is called to increase the balance by the amount received as a parameter. The updatedbalance is returned by the method.refund(): voidThis method is called when any monies owned to the student is paid out. This method can onlyrefund a student if the balance is negative. It displays the amount to be refunded and set thebalance to zero. (Use Math.abs(double) in your output message). If there is no refund, display anappropriate message.Test your StudentAccount class by creating objects and calling the methods addFees(), pay() andrefund(). Use toString() to display the object’s data after each method calledarrow_forwardDice Rolling Class In this problem, you will need to create a program that simulates rolling dice. To start this project, you will first need to define the properties and behaviors of a single die that can be reused multiple times in your future code. This will be done by creating a Dice class. Create a Dice class that contains the following members: Two private integer variables to store the minimum and maximum roll possible. Two constructors that initialize the data members that store the min/max possible values of rolls. a constructor with default min/max values. a constructor that takes 2 input arguments corresponding to the min and max roll values Create a roll() function that returns a random number that is uniformly distributed between the minimum and maximum possible roll values. Create a small test program that asks the user to give a minValue and maxValue for a die, construct a single object of the Dice class with the constructor that initializes the min and max…arrow_forwardFocus on classes, objects, methods and good programming styleYour task is to create a BankAccount class. Class name BankAccount Attributes __balance float float __pin integer integer Methods __init_()get_pin()check_pin()deposit()withdraw()get_balance() The bank account will be protected by a 4-digit pin number (i.e. between 1000 and 9999). The pin should be generated randomly when the account object is created. The initial balance should be 0.get_pin()should return the pin.check_pin(pin) should check the argument against the saved pin and return True if it matches, False if it does not.deposit(amount) should receive the amount as the argument, add the amount to the account and return the new balance.withraw(amount) should check if the amount can be withdrawn (not more than is in the account), If so, remove the argument amount from the account and return the new balance if the transaction was successful. Return False if it was not.get_balance()…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education