Write a method for the content class

Assignment Help JAVA Programming
Reference no: EM132313996

Programming Fundamentals Assignment -

Objective - The main objective of this assignment is to familiarize you with object oriented design and programming. Object oriented programming helps to solve complex problems by coming up with a number of domain classes and associations. However identifying meaningful classes and interactions requires a fair amount of design experience. Such experience cannot be gained by classroom-based teaching alone but must be gained through project experience.

This assignment is designed to introduce different concepts such as inheritance, abstract classes, method overloading, method overriding, and polymorphism.

General Requirements -

1. Your final code submission should be clean, neat, and well-formatted (e.g., consistent indentations) and abide by the formatting guidelines.

2. Identifiers should be named properly and camel case e.g. UsedCar (class) and carPrice (variable). [Google "camel case"]

3. You must include adequate meaningful code-level comments in your program.

4. For each input from the user, display appropriate prompt message.

5. For each invalid input from the user, display appropriate error message.

6. IMPORTANT: your code should be able to compile and run under command-line.

Assignment overview -

A PlayStore is a standalone digital marketplace that allows users to browse and download mobile applications (APPs). The PlayStore also serves as a digital store offering publications like e-books and digital magazines. Applications and publication items in the PlayStore are either free or can be bought for a price.

The program you create will allow the creation of a store, filling it with products, creating users and simulating their interaction with the store (purchasing products, adding comments etc).

Assessment tasks -

Your program should consist of multiple class files where you can demonstrate your knowledge of inheritance, polymorphism, method overriding, abstract classes, etc. You need to write classes, add methods and variables to complete the following tasks performed by the admin of the PlayStore.

There are two sample/starter classes (PlayStoreMain.java and PlayStore.java) provided.

Section 1: The classes and their attributes

Group A - content classes

You may need to define methods wherever appropriate to support these classes.

Class Content

Class Application

Class Publication

Class Book

Class Magazine

Group B - associated classes

Again, you may need to define methods wherever appropriate to support these classes.

Class Comment

Class User

Class PlayStore

Section 2: Functionalities of the classes

User functionalities

1. Method becomePremium. A user can become a Premium user for a cost of $100. A premium user gets 20% discount on each purchase of the contents after becoming premium.

2. Method buyContent, where the parameter is a Content type of object. When a user buys any content, the price of that content needs to be deducted from the balance of that user. Do necessary checks before the deduction. You need to consider whether the user is a premium user or not in this step. The number of downloads of the content should increase after the purchase.

a. Exceptions must be thrown when trying to buy a content with an insufficient balance. The exception thrown must indicate the cause of error, show an appropriate error message, allowing the caller to respond appropriately and recover if possible. Note that when you add exceptions the method calls will need to be surrounded by try/catch blocks.

b. A user may buy multiple content. Write a method showContentBought in the User class to show the list of names of all the contents that the user has bought. You may add additional attributes in the User class if necessary.

Content and Comment functionalities -

3. Write a method for the Content class, where a comment/review (which is a Comment type of object) from users can be added to a Content object.

4. Write a method showComments in the Content class to show all the comments of a Content object (e.g. a particular game or book).

PlayStore and Admin functionalities -

5. Write a method showContent of the PlayStore class to show a list of all available contents. Also write a method for each type of contents to show the list of contents of that type (e.g., show all applications, show all books, show all magazines).

Do you need to write a method for each type? Is that possible to use one method for this task? (Hint: You may find Java getClass() method in java.lang.Object useful).

Use of Java Collections -

6. You are encouraged to use collections such as ArrayList and HashMap. ArrayList implements an array which can grow indefinitely. HashMap allows an association to be created between keys and objects. Using such classes also reduces the amount of code required as they provide methods for retrieving required objects easily.

Input and output -

Your program should hard code a list of objects including content objects, user objects and comment objects etc. for testing purpose. See the skeleton sample code. (During marking, we may replace these objects with our own to test your program).

You program should have a simple menu to allow an admin to perform aforementioned tasks such as:

  • upgrading a member to premium account;
  • purchasing one item for one user;
  • listing all available contents;
  • showing all purchased items of a user;
  • showing all comments of a content;

Input validation and error handling should be implemented. Input and output should be inside of the class PlayStoreMain.

Attachment:- Assignment Files.rar

Verified Expert

The project is to implement a online play store in java. The project provides the facility to create different kind of contents like applications, ebooks, magazines etc. And we can also create user who can buy different content. Some of the contents are paid and some are free. User can be upgraded to become a premium user, so user gets discount for every purchase he makes in the play store. User can add reviews on the content which he buys and the software can show the list of all the contents available currently. It can also show the list of comments for a particular content and also can show all the comments of each user.

Reference no: EM132313996

Questions Cloud

Threats to the global environment : Identify four issues that have biggest impact on global environment. Write opening statement describing perception of each threat.
Annotation that summarizes the central theme : Write a concise annotation that summarizes the central theme and scope of TWO articles about the hospitality industry in china.
Discuss the elements of effective programming style : ISY1003 - Foundations of Programming - Australian Institute of Higher Education - create a program which could further evolve io to their major assignment
Sociologists work to understand role religion serves : Sociologists work to understand the role religion serves in our society. does religion bring people together or does it create more space between them?
Write a method for the content class : COSC2531 Programming Fundamentals Assignment - RMIT University, Australia. Write a method for the Content class
Require mandatory oral history paper : This class will require a mandatory Oral History paper in which you are required to interview an elder in your family and apply course material to their lives.
Political self-test activity : This discussion is mandatory, counts as 10 points towards your overall class grade, and is connected to the I Side With Political Self-Test Activity.
Implementation of flexible workforce arrangements : Identify four challenges associated with the implementation of flexible workforce arrangements and describe the strategies that could be used to address them
Stages of the business planning cycle : What are the eight main stages of the business planning cycle?

Reviews

len2313996

5/30/2019 1:47:38 AM

This is an individual assignment worth 20% of your final grade. The grading is based on both demonstration and final code submission. You must demonstrate your assignment in your timetabled practical class prior to your final submission. Final submission - The final submission is due on week 12. Your final submission through Canvas should be a zip file that includes the following files – The java files of your assignment. Do not submit the .class file.

len2313996

5/30/2019 1:47:32 AM

If you are unable to complete the code, please also submit a word or pdf document file with the brief description of problems encountered and lessons learnt. If you have not received full marks during the demonstration and then made any change in your code afterwards, submit a word or pdf document file with the brief description of changes as well. Submission - Submission will be through Canvas. You are required to zip your .java files for the submission.

Write a Review

JAVA Programming Questions & Answers

  Write a program with an array of seven payroll objects

Design a PayRoll class that has data members for an employee's first and last name, hourly pay rate, number of hours worked.

  Draw a flowchart to calculate the gross pay

Draw a flowchart to calculate the gross pay. Write the pseudo code that corresponds to the flowchart in Step d above. Draw an event diagram for Gross Pay event.

  Build a graphical user interface using javafx

Enhance your ability to build a Graphical User Interface using JavaFX - Incorporate text file handling in your program to import and export data

  Complete bst implementation

Complete BST implementation: - Write methods for ImOrder, PreOrder and PostOrder Traversals - Write min() method - Write Successor () method - Extra Credit Implement Binary Heapusmg An&Y Node implementation

  Create a new project called fractions

You are going to write an API for a Fractions class. It will accept fractions as input and perform various mathematical operations on them -  Create a new project called Fractions. Within Fractions, create a new class called Fraction. NetBeans will..

  Develop your own fully functional text-based adventure game

Develop your own fully functional text-based adventure game. You are allowed to repurpose any example or exercise code you have implemented in the lab, assuming

  Design and code a swing gui to translate test

Design and code a SWING GUI to translate test this is input in English into Pig Latin - A sample application is shown next with the text translated to Pig Latin

  Write splash screen applet that display name of your company

Write a splash screen applet that displays the name of your company or school, the address, the Web address, and your school's logo.

  Implement a class icecreamcone

Implement a class IceCreamCone with methods getSurfaceArea() and getVolumn(). In the constructor, supply the height and radius of the cone. Be careful when looking up the formula for the surface area

  Write a program in java to read 5 integers

Write a program in Java to read 5 integers and print their sum and average.Use loop statements in your code - Write a program in Java to read 5 integers

  Write a graphical application that draws a spiral

Write a graphical application that draws a spiral, such as the following

  What advantages and disadvantages of ajax

Select and submit a Architectural Design Pattern; explain why you selected that particular pattern - What advantages and disadvantages of Ajax, JSON, XML

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