Write a class representing a line item in a shopping cart

Assignment Help Programming Languages
Reference no: EM13948952

JAVA. Write a class representing a line item in a shopping cart:

The characteristics of this class are the name of the product, the cost per unit, and the number of items. This class is named LineItem.Provide a constructor that takes 3 arguments, and initializes the corresponding instance variables. Provide the assessors to the 3 instance variables.

Write a class representing a shopping cart: a shopping cart contains a list of line item objects. This class is named ShoppingCart: provide a constructor for this class, a method to add a line item object to it, and a method printing out its content, with the total cost adding up the cost of all line items.

Write a test program that creates 2 shopping carts, and asks the user to input the content of each shopping cart. Once the user is done inputting the content of the shopping carts, the program displays their contents with their cost.

The programs should compile and run without errors.

Test the program and provide a list of comprehensive test cases used to validate the application and include these test cases in a word document containing all UML diagrams and descriptions. The test data can be shown in a table that includes input data, expected output, actual output and pass/fail results from the test.

Reference no: EM13948952

Questions Cloud

What are the time and space requirements for computing t(n) : The following recurrence equation gives the expected number of comparisons for Quicksort, given that the "pivot element" is selected uniformly at random from the list
Design of employee benefits packages in large companies : How might the increasing diversity of the workforce affect the design of employee benefits packages in large companies? One observer argues that external equity should always be the primary concern in compensation, noting that it attracts the best e..
What is the dividend yield and capital gains yield : Stephanie Enterprises has bonds that have a 9 percent coupon rate. The interest is paid semiannually and the bonds mature in 8 years. Their par value is $1,000. The prices of the bonds are $1,070, and are callable in 5 years with a call price of $1,0..
To calculate the present value of a business : To calculate the present value of a business, the firm's free cash flows should be discounted at the firm's:
Write a class representing a line item in a shopping cart : Test the program and provide a list of comprehensive test cases used to validate the application and include these test cases in a word document containing all UML diagrams and descriptions.
What are interest and principal portions in second payment : A 15-year, $160,000 mortgage has a rate of 5.7 percent. What are the interest and principal portions in the first payment? What are the interest and principal portions in the second payment?
What is the significance of the correlations : What is the strength of the correlations between the variables? What measure of quality is impacted most by relationship conflict? Task Conflict? What is the significance of the correlations?
What per-unit inventory cost reported on grehans sheet : What per-unit inventory cost will be reported on Grehan's balance sheet at the end of the year? What will be the reported income?
Most expensive type of external financing of equity : What is the most expensive type of EXTERNAL financing of equity for a company? Why? How can a company use economies of scale when it comes to external raising of capital through equity? Describe the types of fees that are typically included in flotat..

Reviews

Write a Review

Programming Languages Questions & Answers

  Create a working program for alpha testing

you want to put together the work that has been completed to deliver a working program for alpha testing. You will combine the elements you have written to this point and deliver a working solution.

  Differences between sql and procedural programming

Describe some of the differences between SQL and procedural programming languages such as C and VB

  Write a while and a do-while loop

Pick one or more examples from everyday life and write a WHILE and a DO-WHILE loop.

  Write a program to prints the sum of all elements with an

write a program to prints the sum of all elements with an even index and all elements with an odd index of the

  Write the required lines of code

Write the required lines of code that will create a ServerSocket object with a port number 3421 on which the server program is going to listen for client communications. Write the required lines of code that will create a new socket object

  Perl programming

Create a list of messages that you think would be necessary during server-client and client-client interactions. Do not rely on the implicit acknowledgement of Transmission Control Protocol (TCP) but provide a mechanism for an explicit acknowledgm..

  Write program to accept number from user-fibonacci series

Write a program that accepts a number 'n' from the user and generates Fibonacci series till n (Fibonacci series starts with 0 and 1.

  Determine the relative displacement and total acceleration

Determine the relative displacement and total acceleration as functions of time. Then find the peak values of displacement, velocity and total acceleration for different periods and plot the resulting displacement and acceleration response spectra..

  Non-negative positions in positions

Write a predicate pick(+From, +Positions, -Picked) that unifies Picked with an atom consisting of the characters in From at the zero-based, non-negative positions in Positions.

  Add a column to a table

a user can add column to the table ,where the program sort them and display them sorted

  Design and implement class instance data for title of book

Design and implement a class called Book that contains instance data for the title, author, publisher, and copyright date. Define the Book constructor to accept and initialize this data.

  Write a program which manipulates fractions

Write a program which manipulates fractions. It should get two fractions from the user by inputing two numerators and two denumerators (integers) from 0 to 999 and then have the user select an operation from addition, subtraction, multiplication, ..

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd