designing software solutions for entities in and around campus
After hearing the excellent job you have done designing software solutions for entities in and around campus, your work comes full circle when the University of Florida English department asks you to create an autograder for its introductory class. There are many types of students who are taking this class. Some are high-achieving high school students, some UF undergraduate students, and some graduate students who need a refresher. They would like to create a parent object that can be extended to provide functionality for a number of kinds of students. The department would also like to have the ability to supply the name of a file containing an essay (as a numeric ID) and have you grade the essay, by deducting an appropriate number of points for every word that is misspelled. After reading in the UF ID, which you will use to open the correct essay file, you will create an output file that contains the student’s grade.
Objective
- Read in the file given
- Count the number of misspelled words
- Deduct points accordingly for each misspelled word.
- -1 High School Student, -3 College Student, -5 Graduate Student
- Generate an output file that contains the student’s graded output
Your Assignment
You will need to create five files complete this project and name them exactly as follows: Project5.java, Student.java, HighSchoolStudent.java,UndergraduateStudent.java, and GraduateStudent.java. TheProject5.java file will be the only file to contain a main() method. Each of the .java files and their associated classes are described below:
The Student Class
The Student class, which is stored in Student.java, will act as your parent class from which the different types of students will be derived from. This class must have the following members:
- Fields for the following attributes
- Name
- ID Number
- “Getter”/”Setter” methods for each attribute
- public String getName()
- public void setName(String n)
- public String getIDNumber()
- public void setIDNumber(int id)
- A method that will return a String of all of the attributes for this object
- public String toString()
- An appropriate constructor
- The constructor must initialize both fields of the Student object with the constructor’s parameters
- public Student(String n, int id)The HighSchoolStudent ClassThe HighSchoolStudent class, which is stored in HighSchoolStudent.java, will be a child class of the Student Class. This class must have the following members:
- A field for the following attribute
- Name Of School
- A “getter” and “setter” method for this attribute
- public String getNameOfSchool()
- public void setNameOfSchool(String schoolName)
- A method that will return a String of all of the attributes for this object
- public String toString()
- An appropriate constructor
- The constructor must initialize both fields of the Student object with the constructor’s parameters
- public HighSchoolStudent(String n, int id, String schoolName)The UndergraduateStudent ClassThe UndergraduateStudent Class, which is stored inUndergraduateStudent.java, will also be a child class of the Student Class. This class must have the following members:
- A field for the following attribute
- Major
- A “getter” and “setter” method for this attribute
- public String getMajor()
- public void setMajor(String major)
- A method that will return a String of all of the attributes for this object
- public String toString()
- An appropriate constructor
- The constructor must initialize both fields of the Student object with the constructor’s parameters
- public UndergraduateStudent(String n, int id, String major)The GraduateStudent ClassThe GraduateStudent Class, which is stored in GraduateStudent.java, will be the final child class of the Student Class. This class must have the following members:
- Fields for the following attributes
- Major
- Advisor
- “Getter”/“Setter” methods for each attribute
- public String getMajor()
- public void setMajor(String major)
- public String getAdvisor()
- public void setAdvisor(String advisor)
- A method that will return a String of all of the attributes for this object
- public String toString()
- An appropriate constructor
- The constructor must initialize both fields of the Student object with the constructor’s parameters
- public GraduateStudent(String n, int id, String major, String advisor)The Project5 ClassThe Project5 Class, which is stored in Project5.java, will hold the main method of your program. Your main method will first read in the words that make up your dictionary from a file, and will then create different Student objects based on the files that your program will read from. Your program will then grade the essay that the student has written. Your program should handle FileNotFoundException and print to the console as shown in the sample below!
Your main method will prompt the user to specify the file that hold the dictionary information. You will then attempt to open the file and input the contents of the file into an array to be used by the remainder of your program.
Your program will then ask the user to specify the name of the file that holds the student information. You will then attempt to open the file, create a Student object based on the information given in the file and read the student’s essay from the file.
The first line in the file will identify the classification of the student (High School, Undergraduate, or Graduate)
The following lines will supply the values for the attributes of the specific classification, such as Name, ID Number, and Name Of School for a High School Student.
The remainder of the file will be the essay that the student has written.
- After everything is read from the student file, your program will grade the essay and output the result to a new file.
You will read though the essay and determine whether or not a word is misspelled. If a word is misspelled, deduct the appropriate number of points from the student’s grade. The grade cannot be negative!
You will write the output to a text file (ID_graded.txt) with the same format shown in the Sample Runs section, where ID is the ID of the person whose essay is being graded.
- Once the grade has been recorded, your program will start again at Step 2. However, if you are done grading essays, the user will type “Finished”.Sample Essay File (saved as 11111111.txt)Graduate StudentJohn Smith11111111Computer ScienceKyla McMullenThis esasy is not very long. I hope my advisor wont be agnry with me.Sample Essay File (saved as 12345678.txt)Undergraduate StudentJane Doe12345678Mechanical EngineeringWriting an essay is hard. If I had a nickel for every misspeled word in this essay I would have exactly one nickel.Sample Essay File (saved as 99999999.txt)HighSchool StudentAllen Anderson99999999Gainesville High SchoolShall I compear thee to a summer's day?Thou art more lovely and more temparate:Rough winds do shake the darling buds of May,And summer's leese hath all too short a dateSample Output File (saved as 11111111_graded.txt)Graduate Student John SmithStudent ID: 11111111Major: Computer ScienceAdvisor: Kyla McMullenReceived a score of 90 with 2 misspelled words:(1)esasy(2)agnrySample Output File (saved as 12345678_graded.txt)Undergraduate Student Jane DoeStudent ID: 12345678Major: Mechanical EngineeringReceived a score of 97 with 1 misspelled words:(1)misspeledSample Output File (saved as 99999999_graded.txt)High School Student Allen AndersonStudent ID: 99999999Name of School: Gainesville High SchoolReceived a score of 96 with 4 misspelled words:(1)temparate(2)winds(3)buds(4)leeseSample Run (input in red)Please specify the name of the file that contains the dictionary information.pineappleFile pineapple cannot be found!Please specify the name of the file that contains the dictionary information.dictionaryFile opened successfully!Please specify the ID of the student whose essay will be graded.11111111File opened successfully!Please specify the ID of the student whose essay will be graded.12345678File opened successfully!Please specify the ID of the student whose essay will be graded.pokemonFile pokemon cannot be found!Please specify the ID of the student whose essay will be graded.FinishedOther Important Notes:Please make sure to mimic the output in the Sample Runs, you guys know the drill by now. Also please be sure to name your files appropriately. In addition, make sure to comment your code. If your program needs to be regraded manually, it would benefit your grade if your TA were to actually be able to understand what you are trying to accomplish.Submission Requirements
- Name the classes described above as Project5.java, Student.java,HighSchoolStudent.java, UndergraduateStudent.java, and GraduateStudent.java
- This time we actually want you to create a folder since more than one file is being submitted. To do this, please read and follow these instructions :
- Create a new folder and name it “Project5”
- Insert the 5 Java files Project5.java, Student.java,HighSchoolStudent.java, UndergraduateStudent.java, and GraduateStudent.java into the folder that you just created in the previous step
Notes
- If you submit the folder without zipping, your project will not be graded.
- If your zip file is not named project5_id.zip, your project will not be graded.
- If you do not name the items above exactly as specified, where specified, your project will not be graded.
- Please only create one Scanner object to read the user input, otherwise, your grading may/will be delayed.
- Please convert both the dictionary word and essay word to lowercase and remove all punctuation during comparison.
- It is highly recommended that you test your program piece by piece before assembling your final code. You will have a much easier time if you build your program piece by piece rather than trying to write the entire program. Pay very close attention to the order that you give inputs to the sample program. Your output should not differ in any way from the sample output. Using additional prompts, words, abbreviations, etc may result in the grading program taking unnecessary points off and the world’s smallest violin being played for your sorrows.
Answers
Status NEW
Posted 29 May 2017 01:05 AM
My Price 9.00
-----------
Not Rated(0)