SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 5 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 08 Nov 2017 My Price 10.00

I would like help doing this assignment in the attachment.

Retail Transaction Programming ProjectProject Requirements:1. Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, aLineItemclass and aTransactionclass. TheLineItemclass will represent an individual line item of merchandise that acustomer is purchasing. TheTransactionclass will combine severalLineItemobjects and calculate an overall total price for the line item within the transaction.There will also be two test classes, one for theLineItemclass and one for theTransactionclass.2. Design and build aLineItemclass. This class will have three instance variables.There will be anitemNamevariable that will hold the identification of the line item(such as, "Colgate Toothpaste"); aquantityvariable that will hold the quantity ofthe item being purchased; and apricevariable that will hold the retail price of theitem. TheLineItemclass should have a constructor, accessors for the instancevariables, a method to compute the total price for the line item, a method toupdate the quantity, and a method to convert the state of the object to a string.Using Unified Modeling Language (UML), the class diagram looks like this:LineItem- itemName : String- quantity : int- price : double+ LineItem( String, int, double )+ getName( ) : String+ getQuantity( ) : int+ getPrice( ) : double+ getTotalPrice( ) : double+ setQuantity( int )+ setPrice( double )+ toString( ) : Stringa. The constructor will assign the first parameter to the instance variableitemName, the second parameter to the instance variablequantity, andthe third parameter to the instance variableprice.b. The class will have three accessor methods—getName( ),getQuantity( ),andgetPrice( )—that will return the value of each respective instancevariable.
Background image of page 1
© 2014 Laureate Education, Inc.Page 2 of 4c. The class will have two mutator methods,setQuantity( int )andsetPrice(double ), that will update the quantity and price, respectively, of the itemassociated with the line of the transaction.d. The methodgetTotalPrice( )handles the conversion of the quantity andprice into a total price for the line item.e. The methodtoString( )allows access to the state of the object in aprintable or readable form. It converts the variables to a single string thatis neatly formatted.Note:Refer to the textbook for a discussion of escape sequences. Theseare characters that can be inserted into strings and, when printed, willformat the display neatly. An escape sequence for the tab character canbe inserted to get a tabular form when printing. This tab character is "\t".TheLineItemclass will have atoString( )method that concatenatesitemName,quantity,price, andtotal price—separated by tabcharacters—and returns this new string. When printing an object, thetoString( )method will be implicitly called, which in this case, will print astring that will look something like:Colgate Toothpaste qty 2 @ $2.99$5.983. Build aTransactionclass that will store information about the items beingpurchased in a single transaction. It should include acustomerIDandcustomerName. It should also include anArrayListto hold information abouteach item that the customer is purchasing as part of the transaction.Note:You must use an ArrayList, not an array.4. Build aTransactionTestclass to test the application. The test class shouldnotrequire any interaction with the user. It should verify the correct operation of theconstructor and all methods in theTransactionclass.Specific Requirements for the Transaction Class1. TheTransactionclass should have a constructor with two parameters. The firstis an integer containing the customer’s ID and the second is a String containingthe customer’s name.2. There should be a method to allow the addition of a line item to the transcript.The three parameters for theaddLineItemmethod will be (1) the item name, (2)the quantity, and (3) the single item price.3. There should be a method to allow the updating of a line item already in thetransaction. Notice that updating an item means changing the quantity or price(or both). The parameters for theupdateItemmethod are also (1) the item name,(2) the quantity, and (3) the single item price. Notice that the updating of a
Background image of page 2

Attachments:

Answers

(5)
Status NEW Posted 08 Nov 2017 08:11 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)