Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Write a CashRegister class that can be used with the RetailItem class that you wrote in Part 1. The CashRegister class should simulate the sale of a retail item. It should have a constructor that accepts a RetailItem object as an argument. The constructor should also accept an integer that represents the quantity of items being purchased. In addition, the class should have the following methods:• The getSubtotal method should return the subtotal of the sale, which is the quantity multiplied by the price. This method must get the price from the RetailItem object that was passed as an argument to the constructor.• The getTax method should return the amount of sales tax on the purchase. The sales tax rate is 6 percent of a retail sale.• The getTotal method should return the total of the sale, which is the subtotal plus the sales tax.Demonstrate the class in a program that asks the user for the quantity of items being purchased and then displays the sale's subtotal, amount of sales tax and total.And here is my RetailItem Class I wrote....import java.io.*;import java.util.Scanner; //Needed for Scanner Classpublic class RetailItem {private String description; // Name of itemprivate int units; // Amount of unitsprivate double price; // Price of each unitpublic RetailItem(){}// Counstructor with arguementspublic RetailItem(String des, int u, double p){description = des;units = u;price = p;}/***This setDescription Method sets the item description*@param des The String stored in the description field.*/public void setDescription (String des){description=des;}/***This setPrice Method sets the price of the item.*@param p The value stored in the price field.*/public void setPrice (double p){price=p;}/***This setUnits Method is the number of units of a*specific item.*@param u The value stored in the units field.*/void setUnits(int u){units = u;}/***The getUnits method returns the number of units.*@return The Value in the Units field.*/public int getUnits(){return units;}/***The getDescription method returns the description of*the item.*@return The despription in the description field.*/public String getDescription(){return description;}/***The getPrice method returns the items price.*@return The value in the price field.*/public double getPrice(){return price;}}/***This program demostrates the RetailItem Class*/class RetailTest{public static void main (String [] args){String str ="Shirt";//Creates new RetailItem objects.RetailItem r1=new RetailItem ("Jacket", 12, 59.95);RetailItem r2=new RetailItem ("Designer Jeans", 40, 34.95);RetailItem r3 =new RetailItem ();//function call to set valuesr3.setDescription(str);r3.setUnits(20);r3.setPrice(24.95);//Output of dataSystem.out.println("\tDescription\t\tUnits on Hand\t\tPrice");System.out.println("Item#1\t"+r1.getDescription()+ " \t\t\t "+r1.getUnits()+ " \t\t\t " + r1.getPrice());System.out.println("Item#2\t"+r2.getDescription()+ " \t "+r2.getUnits()+ "\t\t\t\t" + r2.getPrice());System.out.println("Item#3\t"+r3.getDescription()+ " \t\t\t "+r3.getUnits() +" \t\t\t " + r3.getPrice());//Exit programSystem.exit(0);}}
Write a C program that compare the time required to compute the product of two 10,000 x 10,000 matrices with and without optimization for locality.
Write a program to calculate students average test scores
Write a main function to input 20 integers in range of 1-6, function should count number of times the numbers 2 and 5 occur. function must declare statics variables count2 and count5.
For each of problems write C++ code to do the required task. Receive the number and find out whether it is odd or even.
Design and code a new function that accepts as parameters the gross pay by value and the federal tax, state tax, local tax, SS tax, and net Pay by reference.
Write a recursive function void reverse ( ) that reverse a sentence
Explain why, if on some round, all the new strings generated for any syntactic category are longer than s, and s has not already been generated for L(), then s cannot ever be put in L(). Hint: Use Exercise 11.3.5.
Maze program. In this assignment you will represent a maze with a binary tree. . The starting point is node N and the ending point is node Z.
Create an application that has two heaps. Place a linked list into each heap. Select one hundred random numbers. Place each of the random numbers into each heap - CSI 345 - Spring 2014 S2
C language, compute a program that calculates three RESISTANCE inputs, and gives you the total resistance in OHMS. Like this, the total resistance is _____ ohms. These are three parallel circuits so the formula would be (1/R1 + 1/ R 2 + 1/ R 3 ) -1
Write two short C programs and solve four exam-style problems.
Writing a program that creates a linked list from 100 randomly generated numbers and sorts the using a heap. One heap in ascending order and one heap in descending order. Then displays the original linked list and both sorted lists.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd