A small programming assignment in Smalltalk

youwilldefineaclassnamedPersonthathastwostringmembervariables:FirstName and LastName, and two derived classes PF_Student (representing a Pass/Fail grading student) and Std_Student (representing a standard grading student). Both derived classes have three additional integer member variables, exam1, exam2 and exam3, to represent three exam scores in a semester. The semester weighted average (or simply the semester average) for a student is 0.25*exam1+0.25*exam2+0.5*exam3. For a Pass/Fail grading student, his or her letter grade for the semester is either P (Pass, if the semester average >=60) or F (Fail, <60). The semester letter grade for a standard grading student can be A (if the semester average >=90), B(<90, but >=80), C(<80, but >=70), D(<70, but >=60) or F(<60).

The information about the students in a class will be stored in a file as shown below. Each student has six fields (student type, first name, last name, exam1, exam2 and exam3) and occupies a line. Two fields of a student are separated by a space. The number of students in the file is unknown. The following seven students are stored in a file named students.dat and you can download it from Blackboard.

pf Jeremy Greer 80 50 65
std Maria Garcia 70 90 20
std Floyd Jenkins 100 100 90
pf Carlton West 70 70 10
std Rose Harvey 85 85 95
pf Viola Jennings 50 70 80
std Robert Johnson 90 90 70

Your job is to read the student information from a file with its filename furnished as a command line argument, compute the semester average (a real number) and the letter grade for each student, and compute the class average for the semester (a real number too). Finally, print out a list in the format as shown below. In the printout, each student has four fields, first name, last name, letter grade and a comparison result (Below, Above or Equal) to indicate whether the semester average of that student is below, above or equal to the class semester average. For example, the individual semester averages for these 7 students shown above are 65.0, 50.0, 95.0, 40.0, 90.0, 70.0 and 80.0 respectively. The class semester average is (65.0+50.0+95.0+40.0+90.0+70.0+80.0)/7 = 70.0. Therefore, the comparison results for these 7 students are Below, Below, Above, Below, Above, Equal and Above respectively, as shown below.

Jeremy Greer P Below
Maria Garcia F Below
Floyd Jenkins A Above
Carlton West F Below
Rose Harvey A Above
Viola Jennings P Equal
Robert Johnson B Above

You need to have the following files, person.st, pf_student.st, std_student.st and main.st. You will execute your program with gst person.st pf_student.st std_student.st -f main.st students.dat.

You can assume the user will enter the correct command line to execute your program. The data file provided by the user can always be opened for reading, and the data file will always contain valid data, as specified above.


What You Need To Do

  • Create a directory named exam2 on your machine. Download students.dat from Blackboard to the exam2 directory.
  • Create 4 files: person.st, pf_student.st, std_student.st, and main.st to implement the task as described.
  • When you are ready to submit your exam, compress your exam2 directory into a single (compressed) zip file,exam2.zip. No other compressed file formats will be accepted.
  • Once you have a compressed zip file named exam2.zip, submit that zip file.

Get Help With a similar task to - A small programming assignment in Smalltalk

Login to view and/or buy answers.. or post an answer
Additional Instructions:

pf Jeremy Greer 80 50 65 std Maria Garcia 70 90 20 std Floyd Jenkins 100 100 90 pf Carlton West 70 70 10 std Rose Harvey 85 85 95 pf Viola Jennings 50 70 80 std Robert Johnson 90 90 70

Related Questions

Similar orders to A small programming assignment in Smalltalk
JavaScript Assignment
Assignment details in the Word file attached. I just need the files with the code, I will put them into the website myself....
C++ queue
Use C++ and implement your own queue using linked list that should be templated....
creating a website
Description Use Notepad to create a web site about any subject that interests you. In a Mac use the app, Text Edit. The web site must consist of exactly two linked web pages that use the same external style sheet. (If this is not clear to you, please revi...