Design and implement classes with suitable fields

Assignment Help Programming Languages
Reference no: EM132465785

IMAT5101 Object Oriented Programming Assignment - De Montfort University, UK

The learning outcomes that are assessed by this coursework are:

LO1. Have a comprehensive understanding of OO programming concepts: abstraction, encapsulation, inheritance, etc.

LO2. Be able to select appropriate API facilities in the design, implementation and testing of OO applications and applets.

About this assessment - You are given a scenario for your assignment. This takes the form of a design description and a specification by way of a class diagram. You should gain an understanding of the scenario, implement the class diagram and produce the functionality listed within the use cases.

You should implement each class to the expected standards as discussed and practiced during the module.

Objectives - The objective of this assessment is for you to demonstrate your ability to design and implement an OO system consisting of a set of Java classes and a client program. In particular:

Objective 1. To design and implement classes with suitable fields, constructors, accessor methods, and modifier methods.

Objective 2. To conform to the standard conventions of Java.

Objective 3. To implement classes that are associated by inheritance, delegation, composition and aggregation.

Objective 4. To write a client application that uses your classes to show that they function correctly.

Your Scenario: Shopping Cart

STAGE 1 -

Use Cases: You should have a test class, with a main method, that should complete the following use cases for the "Shopping Cart System" to show it works as expected. Please clearly highlight where each use case is exercised in your test program with comments:

CartTest

UC1: A test program that creates an instance of Cart, populates it with several orders (for both products and discount products), and uses a for-each loop to produce a formatted listing of the orders with their price, the number of items in the cart and the overall total price.

Note: You can either use a data file to dynamically read orders, or hardcode the order instances to add to the cart.

UC2: Test each of the sort methods work as expected, as evidenced by appropriate output.

For the sortOrders(Comparator<Order>) method, you should pass in a custom comparator that sorts by cost (asc) and if these are the same then by product (desc).

UC3: Additionally, test the use of equality by using the contains and remove methods. Also, you should use a PrintWriter to produce a receipt for all of the orders and associated details of the cart, and output these into a text file Cart.txt.

UC4: Add further code to show how each method of Cart can be used. In particular, increase and/or decrease the quantity of one or more of the products in the cart, and then re-print the updated cart listing.

STAGE 2 -

Use Cases: Add the following use case at the end of your existing code in your test program - you may need to update other code that has been affected by the additional changes.

UC5: Create an instance of RewardProcessor, add a selection of products to it (but not all the same as those in your cart), and then test the rewardPoints method appropriately.

STAGE 3 -

Use Cases: Add the following use case at the end of your existing code in your test program - you may need to update other code that has been affected by the additional changes.

UC6: Create four different Order object instances and ensure each has a different price policy - default, buy 1 get 1 free, buy 2 get 1 free, and buy 5 get 1 free.

Calculate the cost of each to show the price policies are being applied correctly, and test each policy with different quantities.

Attachment:- Object Oriented Programming Assignment File.rar

Verified Expert

This assignment is of Java programming to create a shopping cart. It is divided into 3 stages and each stage have different features which are implemented and tested with the result being shown on the screen as well as writing the output to a text file.

Reference no: EM132465785

Questions Cloud

Determine capital assets acquired under lease agreements : Determine Capital Assets Acquired Under Lease Agreements. Upon completion, the building had an appraised value of $10 million and a 40-year useful life.
Calculate diluted earnings per share for mayfair enterprise : Calculate the diluted earnings per share for Mayfair Enterprise?Calculate the basic earnings per share for Mayfair Enterprises for 2016. HINT: For basic EPS
Prepare a general journal entry for each correction : Prepare a general journal entry. Show the calculations for the earnings correction that KC Plastics Inc. must show in the 2017 financial statements.
Prepare journal entries for the ?nancial reorganisation jim : Prepare the journal entries for the ?nancial reorganisation of Jim Cabinets.Jim's Cabinets has been experiencing financial difficulties since
Design and implement classes with suitable fields : Calculate the cost of each to show the price policies are being applied correctly, and test each policy with different quantities
Prepare the journal entries from july : Prepare the statement of changes in equity and the shareholders' equity section of the balance sheet for December 31, 2016.Prepare the journal entries from July
Prepare the statement of changes in equity : Prepare the statement of changes.Determine the amount of dividends received by preferred and common shareholders from the September 30, 2023 declaration.
Demonstrating competence as a social worker : Demonstrating competence as a social worker, social service worker, or human service worker, which may be a field which you plan to work in the future
Prepare the journal entry to record exercise of conversion : Determine and Prepare the journal entry to record the exercise of the conversion option, using the book value method on January 1, 2017.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create the same tables and plots given in the paper

Create a pdf document with all tables/figures, and a few words summarizing each table/figure (like in the paper). Data Set The data set contains one folder for each state.

  Calculates and displays the property tax

Write a java application that calculates and displays the property tax for N property owners. N should be declared as a constant and it should be equal to the largest digit of your student ID number

  Create application consisted of three classes

Create an application comprised of three classes. The first class called Crayon represents one crayon of a particular color and length (height).

  Top-down modular approach and pseudocode to create program

Use top-down modular approach and pseudocode to create a appropriate program to solve it. Where suitable, use defensive programming techniques. Give both pseudocode and flow chart algorithms.

  Write a program that lets the user play the game of rock

Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. When the program begins, the user is asked to seed the random number generator, and a random number in the range of 1 through 3 is generated

  COMP9021 Principles of Programming- Assignment Problem

COMP9021 Principles of Programming University of New South Wales, Australia-Design and implement the solution to a program in the form of a medium sized.

  In what stage of the programming process are flowcharts used

In what stage of the programming process are flowcharts and pseudocode used

  Who is the mother of beatrice

CS-205: Declarative Programming (Prolog) Assignment. Translate the following questions into Prolog queries and try them out: Who is the mother of Beatrice? Who has a child (one or more)? Who is a desencendant of the Queenmother

  Create two objects p and q and generate 10 random numbers

Create Two objects P and Q. in object P the array a is type int and size 10, in Q array a is string type and size 12b. Generate 10 random numbers

  Write program in java to input basic salary of persons

Write the program in java to input basic salary of 15 persons. Each one of them gets 25% of basic as hra (house rent allowance), 15 % of basic as conveyance and 10 % of basic as entertainment allowance.

  Write pseudo code to put scores until e button is hit

The program will keep on prompting you to put more scores until you hit E button on your keyboard. Write one page statement to examine this problem.

  Write a program to enter any number of integers in array

Write a program which permits a user to enter any number of integers, which are then stored in the array. After user enters integers, perform the following operations on array.

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