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 #4COP 2521_706Fall 2005Objectives:- 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, using 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, and more.You are to develop a class called StudentBody. This is the driver class. This means that main() will be located within this class. StudentBody will be responsible for maintaining a number of Courses and Students in these courses. For each Student object, you are to have instance variables: name, classification, numberof 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.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 becreated with two students 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.InputsSo that we are all dealing with the same data, create your objects using this data:(For those bent on getting additional credit, put these entries in separate lines in a sequential file and ‘read’ a string in one line at a time (need Stringtokenizer, of course, and a bit more…. …. don’t ask ‘how many points?’ and you would need to process untilthere are no more inputs…)// create a number of Student objectsStudent stu1 = new Student ("GeorgeWashington", "senior", 120, 375);Student stu2 = new Student ("JohnAdams", "senior", 110, 320);Student stu3 = new Student ("ThomasJefferson", "grad", 80, 240);Student stu4 = new Student ("JamesMadison", "junior", 82, 230);Student stu5 = new Student ("JamesMonroe", "junior", 64, 148);Student stu6 = new Student ("JohnQAdams", "grad", 70, 275);// creates two Course objects via declaration.Course course1 = new Course ("cop2551", "MW6pm", stu4, stu5);Course course2 = new Course ("cis4328", "MW3pm", stu1, stu2 );Course course3 = new Course ("cap6100", "MW7:45", stu3, stu6);This code was copied from my StudentBody.java class file. OutputsYour output should appear as follows: (This is what my program generates with the data above). Use the formatting indicated below.===================================================Course1: cop2551 MW6pmStudent Name: JamesMadisonClassification: juniorHours Taken: 82Grade Points: 230Grade Point Average is: 2.8Student Name: JamesMonroeClassification: juniorHours Taken: 64Grade Points: 148Grade Point Average is: 2.31===================================================Course2: cis4328 MW3pmStudent Name: GeorgeWashingtonClassification: seniorHours Taken: 120Grade Points: 375Grade Point Average is: 3.12Student Name: JohnAdamsClassification: seniorHours Taken: 110Grade Points: 320Grade Point Average is: 2.91===================================================Course3: cap6100 MW7:45Student Name: ThomasJeffersonClassification: gradHours Taken: 80Grade Points: 240Grade Point Average is: 3Student Name: JohnQAdamsClassification: 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.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:A shar file as usual that will contain the individual classes (in the same subdirectory, of course).a Javadoc file – ensure you subscribe to the javadoc formats in ALL of your classes. Look up the @params and @author entries and use these. Only include the .html file in your shar.a single page drawing (you may use Word or Power Point) containing UML class diagrams with associations named and drawn and contents of the classes indicated.You do need to include the attributes and methods. I am looking for three classes, with class names and association / aggregation connections – etc.Internally documented source code that adheres to Java programming standards found in the appendices of your textbook.No pseudo-code


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?