Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE 2 4 0 Introduction to Programming Language 2 | Page Homework 0 6 Programming Assignment ( 5 0 points ) 1 . You are

CSE240 Introduction to Programming Language 2| Page
Homework 06
Programming Assignment (50 points)
1. You are given a partially completed project containing:
1 header file:
patient.h (contains the class Patient)
2 C++ files:
patient.cpp (contains the class function definitions)
hw06q1.cpp (contains the program to work on array of Patient objects)
If you use VS, then create an empty C++ project. Then add the header file and CPP files,
respectively, into your project as shown in the following screenshot:
If you use ASU General g++, then simply put the .h and .cpp files in one folder and compile with
this command:
g++ patient.cpp hw06q1.cpp -o out
Execute with:
./out
Follow the instructions given in the comments of the hw06q1.cpp and patient.cpp files to
complete the missing parts of the project so that the program executes properly. You should
first complete patient.cpp and then go on to hw06q1.cpp.
NOTE: In the homework, list means an array (not a linked list).
This is a menu-driven program that uses the following options:
a) Add a new patient. The patient details (name, age, year of birth, ID) are given as
function arguments. You should add the patient only if the patient is not already present
in the array (compared by name, case sensitive) and there is space in the array to add a
new patient.
b) Display the all patients information. See expected output below.
c) Display only the patients whose age falls within a range (in descending order)
d) Display the oldest patient whose name starts with a specific character. Ask the user for
a character. This function is used to demonstrate garbage collection.
You should start completing the program beginning from Q1. Question numbers are given on
line 33 in hw06q1.cpp.( Q1- Q2 in patient.cpp and Q3- Q6 in hw06q1.cpp)
Expected outputs:

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

Step: 3

blur-text-image

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions