The first program will be a class that holds information (instance variables) about an object of your choice and provides the relevant behavior (methods).

computer science

Description

York University

Faculty of Liberal Arts and Professional Studies

School of Information Technology

AP/ITEC 1620 O&P: Information and Organizations

Winter 2020

 Assignment #2

Due Date: by 11:55 PM on the date indicated on the course website for your section.

Submission method: via Moodle (only specified file types below can be uploaded)

This Assignment is worth 8% of the total final grade.

Create a two .java files and submit using Moodle. Please do not use .zip or other archive files.

See FAQ file on www.pateanu.ca/yorku or the Moodle course site for late assignment rules.

 

Introduction

In this assignment you will create two Java programs:

1.      The first program will be a class that holds information (instance variables) about an object of your choice and provides the relevant behavior (methods).

2.      The second program will be the main program which will instantiate several objects using the class above and will test all the functions (methods) of the class above.

You cannot use any of the home assignments as your submitted assignment.

Your programs must meet the following qualitative and quantitative criteria:

  1. Your class must:

1.      Contain at least 5 instance variables of at least three distinct data types (0.5 marks)

2.      Provide a constructor (0.5 marks)

3.      Provide a toString()  method to print the data of an object in an appropriately formatted string (including text to help the reader understand the data content). (0.5 marks)

4.      Provide two other methods that implement some behaviour of your object; getters and setters do dot qualify, and each method must contain at least 5 Java statements; what the method does must make logical sense and be consistent with the object (1.5 marks)

  1. The main program must:

1.      Instantiate an ArrayList of objects of your class above in part A; Read all the data required by an object in part A from System.In, instantiate the object and store it in the ArrayList; continue retrieving input, creating and storing objects until a sentinel value marks the end of the input. (1.5 marks)

2.      Ensure that ALL input errors will be handled correctly (0.5 marks)

3.      Test both methods of the class above; this will typically involve printing the object before the method is called and after; (1 mark)

4.      Print the content of the object array using the formatted printing method provided by the class (1 mark)

5.      Have correct style (use of the standard template, use of comments, correct alignment and indentation of statements, good choice of names, appropriate use of case) (1 mark)

 

All assignments must compile under the basic Java Development Toolkit (JDK 10 or JDK9). If the assignment does not compile a penalty of 3 marks will be applied. It is strongly recommended that you use only the JDK and NotePad++ for creating the assignment. Instructions for setting up your technical environment are on the Moodle course site.

 

Remember: When in doubt, ASK!


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.