DOC PREVIEW
UNF COP 2551 - Study Notes

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

InputsOutputsProgram #3COP 2551_12004Spring 2011Due: Wednesday, March 9th, start of class.Drop dead date: March 14th (we are on Spring Break then)Objectives:- Gain experience using multiple classes - Gaining experience with Java programs of multiple classes / objects - To gain experience in the detailed design of Java classes as well as Constructors, ToString, and other functionally-required methods. - To gain additional experience with loops and conditional expressions.- To gain experience with method calls and parameter passing- To gain experience with instance variables and class variables.- To gain experience in seeing association relationships and specifically aggregationrelationships and how to implement these. UML diagrams must reflect the associations / aggregation relationships.- To gain experience using DecimalFormat class and charAt method of String.Requirements: This program has much to do about objects and their dependencies and relationships. You will be creating a number of objects, performing some calculations, sending messages, use ToString to print out values of objects, and formatting output.First of all, to accomplish much of this program, you will need to study/review class variables (static variables), DecimalFormat class objects, charAt method of String objects, UML examples, and more.This program deals with students and their classifications (freshman, sophomore, etc.), the class that they are enrolled in, their gpa, and other summary statistics.You are to develop a class called StudentBody. Your ‘Main’ class, and in particular, your main() method will be responsible for maintaining a number of Courses and Students in these courses. You will instantiate six Student objects. For each Student object, you are to have instancevariables: name, classification, number of hours taken, and grade points. Name and classification are strings, with the classification range “freshman” … “senior” and “graduate”. Hours taken and grade points are integers.You will also create a Course class and build three course objects. For each Course object, you are to include instance variables course number, time of offering and two students enrolled in that course. Specifically, each Course object will be created with twostudent objects in it. Course number and time of offering are strings, while students are objects of type Student. You will create three courses, each of which as two students. Input data is presented ahead. Please note that this program is VERY similar to one in your book and in my slides. Please use that as a guide to understand this specification and to help develop your designand implementation.InputsSo that we are all dealing with the same data, create your objects using this data ahead (you may ‘hard code’ these entries into your program at this time. Things will significantly change once we have had arrays. (This code may appear in main())// create a number of Student objectsStudent stu1 = new Student ("George_Washington", "senior", 120, 375);Student stu2 = new Student ("John_Adams", "senior", 110, 320);Student stu3 = new Student ("Thomas_Jefferson", "grad", 80, 240);Student stu4 = new Student ("James_Madison", "junior", 82, 230);Student stu5 = new Student ("James_Monroe", "junior", 64, 148);Student stu6 = new Student ("John_Q._Adams", "grad", 70, 275);// creates two Course objects via declaration.Course course1 = new Course ("cop2551", "MW 6pm", stu4, stu5);Course course2 = new Course ("cis4328", "MW 3pm", stu1, stu2 );Course course3 = new Course ("cap6100", "MW 7:45", stu3, stu6);You will need to design the Student class and the Course class. You will need Constructors and a ToString() in each and maybe more.OutputsYour output should appear as follows: Use the formatting indicated below.===================================================Course1: cop2551 MW 6pmStudent Name: James_MadisonClassification: juniorHours Taken: 82Grade Points: 230Grade Point Average is: 2.8Student Name: James_MonroeClassification: juniorHours Taken: 64Grade Points: 148Grade Point Average is: 2.31===================================================Course2: cis4328 MW 3pmStudent Name: George_WashingtonClassification: seniorHours Taken: 120Grade Points: 375Grade Point Average is: 3.12Student Name: John_AdamsClassification: seniorHours Taken: 110Grade Points: 320Grade Point Average is: 2.91===================================================Course3: cap6100 MW 7:45Student Name: Thomas_JeffersonClassification: gradHours Taken: 80Grade Points: 240Grade Point Average is: 3Student Name: John_Q._AdamsClassification: gradHours Taken: 70Grade Points: 275Grade Point Average is: 3.93 S t a t i s t i c s Total Number of courses offered is: 3 Number of graduate courses is: 1 Number of undergraduate courses is: 2 Total number of students is: 6You will note that for each student listed, his/her grade point average is given. You will need to accommodate this in the appropriate class. Also, note the formatting of the grade point average. Use (“0.##”) for your pattern.Also, please note that the items under Statistics will all come from Courses.java and Student.java. These must be class variables in Courses and in Student and are NOT to be hardcoded; rather, they are to be calculated as follows:- For each object that is created, you are to bump a static course counter in the Course class.- For each student object that is created, you are to bump a static student counter in the Student class.- The number of undergraduate courses needs to be computed. When and where you do this is up to you. However, if the fourth character is greater than a 4, such as cap6100, then the course is a graduate level course. While you can easily see the answer from this data, you must compute it. You will need to use a String method, and be sure you understand HOW this method works. Hint: use the charAt() method. It is pretty straightforward.If your output does not appear as above and/or if you plug in values, your program does not satisfactorily do its job. There are no plug in values, except the objects – for where we are in the learning of java. All else is computed. Deliverables: You will electronically transmit to me:The standard zip file: project2yourname.zip that you are used to.a Javadoc file – ensure you subscribe to the javadoc formats in ALL of your classes. Look up the @params and @author


View Full Document

UNF COP 2551 - Study Notes

Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?