NOTE: this algorithm requires that you read from a file and use an EOF-controlled loop. If you have any questions as to how to proceed, please e-mail me in enough time to help you. There is information in the written lectures about writing EOF loops and toward the end of this problem section.

Your neighbor, an elementary school teacher, has asked you to help her with the 5th Annual Christmas Gala. They’ve planned all sorts of events such as, food, games, and other activities for the children to do in the school’s multipurpose room. The school is a large school, with grades kindergarten through fifth. There are many sections of each grade and hundreds of students attending the school. It is possible that the children may not know many of the children from other classes. Your neighbor wants you to create the logic of a program to print name tags for everyone in the school.

All of the data you’ll need is in a file (you’ll have to use file processing and an EOF loop). Each classes’ data may not be together in the file; this means all student records are in no particular order in the file.

The school class data are in the following format (file description):

File: ClassData
FIELD DESCRIPTION DATA TYPE EXAMPLE
Class Id Character F100
Class Grade Character FIRST
Section Number Numeric 001
Teacher Name Character Palm
Enrollment Numeric 24
Room Character A214

In the file, there is one record for each class section offered at the school. In case you need further explanation of the data, a description of the data is as follows:

  • Class ID uniquely identifies the class record. Each class has an unique identifier to separate it from all other classes. This is necessary because there are multiple records for each grade AND the section numbers are duplicated within each grade (that means there’s a section 001 for first grade and a section 001 for second grade).
  • Class Grade contains the grade level of a class section (kindergarten, first, second, third, fourth, and fifth)
  • Section Number identifies the individual class in a grade. If there are five kindergarten classes, then the section numbers for each of the five sections of kindergarten are 001 through 005.
  • Teacher Name contains the last name of the teacher for the class section.
  • Enrollment contains the number of students enrolled in the class section.
  • Room contains the room number for the class section.

Design a program that would read in each record in the file and print as many name tags as a class section needs to provide one for each student in the class, plus one for the teacher (this data is the enrollment plus 1). The name tag would leave a blank for the student’s (or teacher’s) name so the names can be written in by the teacher before handing them out to the students. The tag would look like this (storyboard):

WELCOME TO CHRISTMAS GALA 2012
My name is ________________________
Class Grade: XXXXXXXXXXXX Section: 999

REQUIREMENTS: again, you MUST use an EOF loop with file processing (open and close files, loop using EOF). You will also need a counting loop to process the name tags for each class section (nested in the EOF loop). You must use modules. What you call them is up to you. I want the main algorithm to look like this:

Start
A beginning module to set up everything
A main loop module
A closing module to finish whatever needs to be finished
Stop

This means I want you to have three module calls in the main algorithm (NO OTHER STATEMENTS). All other modules will be called from within one of the three main modules. How you divide up the work and how many modules is up to you, EXCEPT, I want you to design and call a separate module to print the tag. Please see the output storyboard for output information.

Remember, since you’re reading from a file, there is no input interface required. Do not include input prompts (the file can’t read them). Also, you MUST read in every field in each record, even those you don’t intend to use (therefore, you need variables and read statements for each field).

For this assignment, all variables and constants you declare are global to the program. That means you do not pass ANY parameters/arguments into the modules. You must fully define each module, one at a time, AT THE END of the design after you stop your main algorithm. Include only modules calls in the main algorithm. DO NOT define the statements of the modules inside the main algorithm.

NOTE: do not ask the user to make any calculations. The program should make all calculations. Reminder: this design assignment reads from a file, therefore, there’s no input interface. Also, I’ve given you an output storyboard (the tag). You need to either include it in your design as a separate storyboard OR include the labels from it in your output statements. Assume input from a file and output to a printer.

NOTE: please do not include arrays in your design. It is required that you use an EOF loop to process your records. Do NOT forget to open and close your file.

HINT: When using an EOF-controlled loop, you must read all fields in the file, so you need to include them all in the variable list. Think about that reading in the first field in the file (Class Id) is the variable that will control the loop. For example:

Read ClassID
While not EOF
[Loop Body]
Read ClassId
End loop
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.