Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Student information for Springfield State is stored in a text file named p2-students.txt. There is one student record per line, where the format of

1. Student information for Springfield State is stored in a text file named p2-students.txt. There is one student record per line, where the format of a student record for an on-campus student is:

C id last-name first-name residency program-fee credits where:

  1. The software requirements for this project are:

C

id last-name first-name residency program-fee credits

Identifies the student as an on-campus student. The student identifier number. A string of 13 digits. The student's last name. A contiguous string of characters. The student's first name. A contiguous string of characters. R if the student is a resident, N if the student is a non-resident. A program fee, which may be zero. The number of credit hours for which the student is enrolled.

The format of a student record for an online student is:

O id last-name first-name tech-fee credits

Kevin R. Burger :: Arizona State University :: Rev 024221 :: It is a copyright violation to publish this document w/o permission

Page 1

Programming Project 2

CSE205 Object Oriented Programming and Data Structures Programming Project 2

where O identifies the student as an online student, and id, last-name, first-name, and credits are the same as for an on-campus student. The tech-fee field is T if the student is to be assessed the technology fee or - if the stu- dent is not assessed the technology fee. Here is an example p2-students.txt file, which you can use for testing your pro- gram.

Sample p2-students.txt

C 8230123345450 Simons Jenny R 0 12 C 3873472785863 Cartman Eric N75018 C 4834324308675 McCormick Kenny R 0 20 O 1384349045225 Broflovski Kyle -6

O 5627238253456 Marsh Stan T3

  1. The program shall read the contents of p2-students.txt and calculate the tuition for each student.

  2. The program shall write the tuition results to an output file named p2-tuition.txt formatted thusly:

    id last-name first-name tuition id last-name first-name tuition ...

    where id is the student identifier number, last-name and first-name are the student's name, and tuition is the computed tuition for the student. id shall be output left-justified in a field of width 16, last-name shall be output left-justified in a field of width 20, first-name shall be output left-justified in a field of width 15, and tuition shall be output right-justified in a field of width 8 with two digits after the decimal point. For the sample input file, this is the output file:

Sample p2-tuition.txt

1384349045225 3873472785863 4834324308675 5627238253456 8230123345450 
Broflovski Cartman McCormick Marsh Simons 

Kyle 5700.00 Eric 15625.00 Kenny 8525.00 Stan 2925.00 Jenny 7575.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions