Customer Service Chat
Get quote & make Payment
Java project, computer programming, Programming Languages
NOTE: You will only submit the University.java and EmptyFileException.java files (inside P3.zip/tar)
NOTE on null objects:. From Project 1: Since the array of students in the Course class might have no objects (null), remember to do a null check when traversing the array.
UPDATE March 23rd: There was a slight error in the "university.txt" file provided for part A. Please make sure you work with the latest version.
NOTE: You should NOT modify any classes other than University.java.
For this project you will be storing and retrieving the Sakai system implemented in project 1.
You will first need to download the solution to project 1.
There are two parts to the project:
PART A:. This part involves writing out all the information to a file. Modify the University.java file by adding this method:
public boolean writeToFile(String filename):
-The method should write out all the information to the filename passed in. If successfully written it returns true, otherwise false.
-The file format is as follows: (parentheses indicate the information has to be written out)
University Name: (university''s name)
Current Term: (currentTerm)
Current Year: (currentYear)
Number of Students: (number of students)
Number of Instructors: (number of instructors)
Number of Courses: (number of courses)
The information above is to be written out first. Immediately following the above the information for each student has to be written out as specified below:
Name: (student''s name)
UFID: (student''s ufid)
D.O.B: (student''s dob)
GPA: (student''s gpa)
Number of Courses: (number of courses the student is enrolled in)
Immediately following the above the information for each instructor has to be written out as specified below:
Name: (instructor''s name)
UFID: (instructor''s ufid)
D.O.B: (instructor''s dob)
Immediately following the above the information for each course has to be written out as specified below:
Number of credits: (numCredits)
Instructor UFID: (UFID of the instructor)
Number of TAs: (number of TAs)
TA UFIDs: (ufid of first ta),(ufid of second ta),...,(ufid of last ta)
Current Enrollment: (currentEnrollment)
Student UFIDs: (ufid of first student),(ufid of second student),...,(ufid of last student)
That signifies the end of the file.
Use TestDriver1 to test your solution to Part A.
This driver will produce a file named university.txt. Use the output file provided to compare whether your program writes it out properly.
PART B: This part will involve reading from a file and reconstructing all the objects in the Sakai system.
Create the class EmptyFileException, which will be a subclass of Exception.. This exception is thrown when a file is empty. It will have the following properties and methods:
- String filename; // This represents the name of the file which is empty
Empty constructor which does nothing
- EmptyFileException(String filename)
Takes in the name of the file which is empty and set''s the properties appropriately
public String toString();
It will return a string in this format:
The file (filename) is empty.
Modify the University.java file by adding this method:
public static University readFromFile(String filename):
-This method will read in all the university info from a file and construct the university object.
-If the object is properly created it is returned, otherwise a null object is returned.
-If the file to read from is empty, the method will try-and-catch the EmptyFileException created above.
When the exception is caught it''s information is printed out (via the toString method).
(HINT: Try to use helper methods for reading in different kinds of objects - Student, Instructor and Course.)
Use TestDriver2 to test your solution. It tries to read in the university.txt file. Compare with our output.
Posted Date: 3/26/2012 3:56:52 AM | Location : United States
Ask an Expert
Java project, computer programming, Assignment Help, Ask Question on Java project, computer programming, Get Answer, Expert's Help, Java project, computer programming Discussions
Write discussion on Java project, computer programming
Your posts are moderated
Write your message here..
Extensive programming platform .net, Extensive programming platform .NET ...
Extensive programming platform .NET It is a new, simple, and comprehensive selection foundation. It is not a selection terminology, but it can handle several selection dialects.
Flowchart and Pseudocode using Control Breaks, Shemrock Inc. is a brake pad...
Shemrock Inc. is a brake pad manufacturing company. This company uses raw materials, such as carbon powder, iron, ash, and resin. It wants to develop an inventory management system
Write a program that should read input from a text file, A hardware store s...
A hardware store sells the following hardware tools: screwdriver, wrench, and tape measure. You are asked to calculate the profit for the store based on the number of tools sold an
Create a directory, The ?rst task in the project is to develop a sane syste...
The ?rst task in the project is to develop a sane system to store change logs and versions of ?les. The simplest approach is to create a "dot" directory in the location of the ?le
Shell script convert the given amount into words, Normal 0 fals...
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Write a program to draw the truck , Write a program to draw the truck follo...
Write a program to draw the truck following figure. The program should buttons to provide When the truck runs left wheels must rotate in the correct direction. Rotating whe
C++ language introduces, C++ language introduces object-oriented programmin...
C++ language introduces object-oriented programming (OOP) features to C language. It offers classes, which provide the four features commonly present in OOP (or some non-OOP) langu
Modularity, Modularity, Abstraction, and Modelling Whether proving a t...
Modularity, Abstraction, and Modelling Whether proving a theorem by creating up from lemmas to simple basic theorems to more accurate results, or designing a circuit by creati
Use an insertion sort to sort an array, Use an insertion sort to sort an ar...
Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE
Write a perl script to assign letter grades to the students, Tasks: Writ...
Tasks: Write a Perl script assignGrades.pl to assign letter grades to the students. Please use the classList2.txt file. Upon invoking, the script will access the file classL
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
Why Us ?
~24x7 hrs Support
~Quality of Work
~Time on Delivery
~Privacy of Work
Human Resource Management
Literature Review Writing Help
Terms & Conditions
Copyright by ExpertsMind IT Educational Pvt. Ltd.