Your Perfect Assignment is Just a Click Away
We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

CS151: Object Oriented Design and Programming

CS151: Object Oriented Design and Programming

San José State University

Computer Science Department CS151, Object Oriented Design and Programming, 07, Spring 2020
Homework #6
Objective:
This homework’s objective is to review and understand the unit on Java collections and how to use them in your Java application.

Details:
Exercise 1:

Define and implement a class that works with Java ArrayList data structure. This class should have the following methods:

Method declaration

Description

ArrayList sort(ArrayList myLst, Boolean ascending)

Accepts an array list of integers and sorts it in ascending or descending order. Make sure to account for cases with duplicate values. The method returns the sorted list.

ArrayList swapLargestSmallest(ArrayList myLst)

Accept an array list of integers and swamps positions of the largest and the smallest elements. If multiple values representing largest/smallest elements are present then pick the first position. The method returns the modified list.

void table(ArrayList myLst)

Accepts an array list of integers, creates a table of unique values and the number of times each value occurs, sorts this table, and outputs it to command line.

Save this class and its definition into a file named ListManipulator.java.

I will test your class with my own tester class using the API specification provided above.

Exercise 2:

Define and implement class Course. This class should contain the following fields: course name, course description, department, time the course starts, weekday the course is held on (for simplicity, let us assume the course only meets once a week). This class should contain getters and setters for all its attributes. This class also needs at least one constructor. Save this class and its definition into a file named Course.java.

Define and implement class Student. This class should contain the following fields: first name, last name, age, gpa, major, department, courses. Age should be an integer value. GPA should be a floating point value. Courses should be a linked list of Course variables. Class Student should contain getters and setters for all its attributes. This class also needs at least one constructor. In class Student implement the following methods: addCourse() to add a new course, removeCourse() to remove a course from this student, sortCourses() to print out a sorted list of courses. Method sortCourses() should accept parameters to specify whether the sorting should be ascending or descending and also based on which course attribute to sort the courses. The output should be printed to command line standard output. Save this class and its definition into a file named Student.java.

I will test your class with my own tester class using the API specification provided above.

Exercise 3:

Define and implement class Person. This class should contain the following fields: first name, last name, and age. Age should be an integer value. This class should contain getters and setters for all its attributes. This class also needs at least one constructor. Save this class and its definition into a file named Person.java.

Define and implement class PersonTest. This class should implement main() method. In the body of the main() method you should create an array list of persons with the following Person instances:

Joe Smith, 40

Amy Gold, 32

Tony Stork, 21

Sean Irish, 24

Tina Brock, 28

Lenny Hep, 18

Sort your list of persons based on their age, both ascending and descending. Sort your list of persons based on their first name, both ascending and descending. Sort your list of persons based on the length of their last name, both ascending and descending. For each output, print the list out to command line standard output. These sort operations should produce 6 different list outputs. Save this class and its definition into a file named PersonTest.java.

Submission:
In your class repo create a directory called “Assignment6” and add all the files created for this homework assignment to that directory.

This homework assignment is assigned on 03/05/2020 and is due on 03/12/2020 before 11:59pm. Email your assignment submission to me at both Yulia.Newton@sjsu.edu and yulia.newton@gmail.com, as well as the grader at akshay.kajale@sjsu.edu. The subject of the email should say “CS151 Assignment 6”. Add your name as it appears on the class roster and the URL to your git repo in the body of an email.

Grading:
Your code must compile and execute successfully in order to get full credit for this assignment. For exercise 1 and 2, I will test your class with my own tester class using the API specification provided in the exercise. For exercise 3, I will compile and execute xxxTestxxx.java file listed in that exercise description.

· Program with no compile errors (5 pts)

· Program executes (5 pts)

· Program outputs what is required by the exercise (5 pts)

A total of 45 points are possible for this homework assignment.

Object Oriented Design, CS151, Section 07 Spring 2019 Page 1 of 5

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Topnotch Essay only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided byTopnotch Essay are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Topnotch Essay is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Topnotch Essay, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.