Question

A file of student records contains name, gender (M or F), age (in years) and marital status (single or married) for each student.
Design an algorithm that will read through the file and calculate the numbers of married men, single men, married women and single women.
Print these numbers on a student summary report.
If any single men are over 30 years of age, print their names and ages on a separate eligible bachelors report.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Design of Algorithm
As main structures we’ll use a DOWHILE to cover the entire file (until EOF), regular IF statements for querying marital status and indexes to compute the requested number of students.
BACHELOR REPORT & SUMMARY REPORT
PRINT_’STUDENT SUMMARY REPORT’ heading
PRINT ‘ELIGIBLE BACHELOR REPORT’ heading
SET TOTAL_STUDENTS ->0
READ FILE_STUDENT_RECORD
DOWHILE (NOT EOF)
IF FILE_STUDENT_RECORD= ‘S’ THEN...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Programming Problems in C++
Homework Solution
$10.00
Programming
Computer Science
C++
Classes
Libraries
Command Line Arguments
Music Files
Statements
Variables
Scripts
Input
Output
Information
Underscores
Spaces
Track Numbers
Lexicographic Sorting
Songs
Get help from a qualified tutor
Live Chats