Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS 3340, Assignment #3: Collections practice (10 points base + 3 extra credit points possible) Due: Friday August 11th @ 5pm. Your job is to

CS 3340, Assignment #3: Collections practice

(10 points base + 3 extra credit points possible)

Due: Friday August 11th @ 5pm.

Your job is to make the code in Test (shown below) produce the output that follows. In doing so, you must:

Use the Test code provided (it will be on BB)

Make sure your output looks EXACTLY like the expected output

Implement the classes Course, CourseSchedule, Registrar. Use a List to implement CourseSchedule

Use a Map to implement Registrar

EXTRA CREDIT (3 points total)

1 point: Support deRegister (removes CourseSchedule from registrar)

2 points: Sort the CourseSchedule every time a Course is added

NOTES:

All of this material has been covered in past lectures. Please review the slides if you need to.

To do the sorting, one of your classes will need to implement Comparable, just as we demonstrated in class. We also covered how to sort collections, which again you should review in the slides if you need to.

This assignment has 3 other pages that follow this one, please mke sure you review

You should also consider looking at the Javadoc pages for List and Map, in case you need those (do a Google search)

public class Test {

public static void main(String[] args) {

// Build Annie's schedule

CourseSchedule annieSchedule = new CourseSchedule("Annie Atom");

annieSchedule.add(new Course("CS 100", "Prof, Smith")); annieSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); annieSchedule.add(new Course("MATH 125", "Prof. Aardvark"));

annieSchedule.display();

// Build Myra's schedule

CourseSchedule myraSchedule = new CourseSchedule("Myra Moore"); myraSchedule.add(new Course("CS 233", "Prof, Jensen")); myraSchedule.add(new Course("CS 234", "Prof. Thomas"));

myraSchedule.display();

// Build Zach's schedule

CourseSchedule zachSchedule = new CourseSchedule("Zach Zween");

zachSchedule.add(new Course("PSYCH 140", "Prof, Arnold")); zachSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); zachSchedule.add(new Course("FRENCH 1", "Prof. Renior"));

zachSchedule.display();

// Register all of them Registrar r = new Registrar();

r.register(annieSchedule); r.register(myraSchedule); r.register(zachSchedule);

// EXTRA CREDIT (1 pt)

r.deRegister("Myra Moore");

r.display();

}

}

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

########## REGISTRATION SUMMARY ##########

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, Arnold

########## REGISTRATION SUMMARY ##########

=== Schedule for Annie Atom ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, CS 3340, Assignment #3: Collections practice

(10 points base + 3 extra credit points possible)

Due: Friday August 11th @ 5pm.

Your job is to make the code in Test (shown below) produce the output that follows. In doing so, you must:

Use the Test code provided (it will be on BB)

Make sure your output looks EXACTLY like the expected output

Implement the classes Course, CourseSchedule, Registrar. Use a List to implement CourseSchedule

Use a Map to implement Registrar

EXTRA CREDIT (3 points total)

1 point: Support deRegister (removes CourseSchedule from registrar)

2 points: Sort the CourseSchedule every time a Course is added

NOTES:

All of this material has been covered in past lectures. Please review the slides if you need to.

To do the sorting, one of your classes will need to implement Comparable, just as we demonstrated in class. We also covered how to sort collections, which again you should review in the slides if you need to.

This assignment has 3 other pages that follow this one, please mke sure you review

You should also consider looking at the Javadoc pages for List and Map, in case you need those (do a Google search)

public class Test {

public static void main(String[] args) {

// Build Annie's schedule

CourseSchedule annieSchedule = new CourseSchedule("Annie Atom");

annieSchedule.add(new Course("CS 100", "Prof, Smith")); annieSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); annieSchedule.add(new Course("MATH 125", "Prof. Aardvark"));

annieSchedule.display();

// Build Myra's schedule

CourseSchedule myraSchedule = new CourseSchedule("Myra Moore"); myraSchedule.add(new Course("CS 233", "Prof, Jensen")); myraSchedule.add(new Course("CS 234", "Prof. Thomas"));

myraSchedule.display();

// Build Zach's schedule

CourseSchedule zachSchedule = new CourseSchedule("Zach Zween");

zachSchedule.add(new Course("PSYCH 140", "Prof, Arnold")); zachSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); zachSchedule.add(new Course("FRENCH 1", "Prof. Renior"));

zachSchedule.display();

// Register all of them Registrar r = new Registrar();

r.register(annieSchedule); r.register(myraSchedule); r.register(zachSchedule);

// EXTRA CREDIT (1 pt)

r.deRegister("Myra Moore");

r.display();

}

}

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

########## REGISTRATION SUMMARY ##########

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, Arnold

########## REGISTRATION SUMMARY ##########

=== Schedule for Annie Atom ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, ArnoldCS 3340, Assignment #3: Collections practice

(10 points base + 3 extra credit points possible)

Due: Friday August 11th @ 5pm.

Your job is to make the code in Test (shown below) produce the output that follows. In doing so, you must:

Use the Test code provided (it will be on BB)

Make sure your output looks EXACTLY like the expected output

Implement the classes Course, CourseSchedule, Registrar. Use a List to implement CourseSchedule

Use a Map to implement Registrar

EXTRA CREDIT (3 points total)

1 point: Support deRegister (removes CourseSchedule from registrar)

2 points: Sort the CourseSchedule every time a Course is added

NOTES:

All of this material has been covered in past lectures. Please review the slides if you need to.

To do the sorting, one of your classes will need to implement Comparable, just as we demonstrated in class. We also covered how to sort collections, which again you should review in the slides if you need to.

This assignment has 3 other pages that follow this one, please mke sure you review

You should also consider looking at the Javadoc pages for List and Map, in case you need those (do a Google search)

public class Test {

public static void main(String[] args) {

// Build Annie's schedule

CourseSchedule annieSchedule = new CourseSchedule("Annie Atom");

annieSchedule.add(new Course("CS 100", "Prof, Smith")); annieSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); annieSchedule.add(new Course("MATH 125", "Prof. Aardvark"));

annieSchedule.display();

// Build Myra's schedule

CourseSchedule myraSchedule = new CourseSchedule("Myra Moore"); myraSchedule.add(new Course("CS 233", "Prof, Jensen")); myraSchedule.add(new Course("CS 234", "Prof. Thomas"));

myraSchedule.display();

// Build Zach's schedule

CourseSchedule zachSchedule = new CourseSchedule("Zach Zween");

zachSchedule.add(new Course("PSYCH 140", "Prof, Arnold")); zachSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); zachSchedule.add(new Course("FRENCH 1", "Prof. Renior"));

zachSchedule.display();

// Register all of them Registrar r = new Registrar();

r.register(annieSchedule); r.register(myraSchedule); r.register(zachSchedule);

// EXTRA CREDIT (1 pt)

r.deRegister("Myra Moore");

r.display();

}

}

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

########## REGISTRATION SUMMARY ##########

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, Arnold

########## REGISTRATION SUMMARY ##########

=== Schedule for Annie Atom ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, ArnoldInstructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, Arnold

CS 3340, Assignment #3: Collections practice

(10 points base + 3 extra credit points possible)

Due: Friday August 11th @ 5pm.

Your job is to make the code in Test (shown below) produce the output that follows. In doing so, you must:

Use the Test code provided (it will be on BB)

Make sure your output looks EXACTLY like the expected output

Implement the classes Course, CourseSchedule, Registrar. Use a List to implement CourseSchedule

Use a Map to implement Registrar

EXTRA CREDIT (3 points total)

1 point: Support deRegister (removes CourseSchedule from registrar)

2 points: Sort the CourseSchedule every time a Course is added

NOTES:

All of this material has been covered in past lectures. Please review the slides if you need to.

To do the sorting, one of your classes will need to implement Comparable, just as we demonstrated in class. We also covered how to sort collections, which again you should review in the slides if you need to.

This assignment has 3 other pages that follow this one, please mke sure you review

You should also consider looking at the Javadoc pages for List and Map, in case you need those (do a Google search)

public class Test {

public static void main(String[] args) {

// Build Annie's schedule

CourseSchedule annieSchedule = new CourseSchedule("Annie Atom");

annieSchedule.add(new Course("CS 100", "Prof, Smith")); annieSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); annieSchedule.add(new Course("MATH 125", "Prof. Aardvark"));

annieSchedule.display();

// Build Myra's schedule

CourseSchedule myraSchedule = new CourseSchedule("Myra Moore"); myraSchedule.add(new Course("CS 233", "Prof, Jensen")); myraSchedule.add(new Course("CS 234", "Prof. Thomas"));

myraSchedule.display();

// Build Zach's schedule

CourseSchedule zachSchedule = new CourseSchedule("Zach Zween");

zachSchedule.add(new Course("PSYCH 140", "Prof, Arnold")); zachSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); zachSchedule.add(new Course("FRENCH 1", "Prof. Renior"));

zachSchedule.display();

// Register all of them Registrar r = new Registrar();

r.register(annieSchedule); r.register(myraSchedule); r.register(zachSchedule);

// EXTRA CREDIT (1 pt)

r.deRegister("Myra Moore");

r.display();

}

}

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

########## REGISTRATION SUMMARY ##########

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Annie Atom === Course: CS 100, Instructor: Prof, Smith

Course: ANTHRO 10, Instructor: Prof. Jones Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: PSYCH 140, Instructor: Prof, Arnold Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Myra Moore ===

Course: CS 233, Instructor: Prof, Jensen Course: CS 234, Instructor: Prof. Thomas

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, Arnold

########## REGISTRATION SUMMARY ##########

=== Schedule for Annie Atom ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: CS 100, Instructor: Prof, Smith Course: MATH 125, Instructor: Prof. Aardvark

=== Schedule for Zach Zween ===

Course: ANTHRO 10, Instructor: Prof. Jones Course: FRENCH 1, Instructor: Prof. Renior Course: PSYCH 140, Instructor: Prof, Arnold

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions

Question

why we face Listening Challenges?

Answered: 1 week ago

Question

what is Listening in Context?

Answered: 1 week ago