Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 29 Not yet graded /1 pts Implement the void function \"ReadFile\" that

ID: 3870867 • Letter: Q

Question

Question 29 Not yet graded /1 pts Implement the void function "ReadFile" that will have two parameters: an input file stream called "in", and a patient medical record called "patient_record". The function will read the room_number (integer), age (integer), and hospital_wing (string: north, south, east or west), into a patient record from the data file. Assume that the input file stream is already open. Following is the declaration of the patient record: class patient record public: int room_number, age string hospital_wing Your Answer:

Explanation / Answer

//mention this at the starting point of the code

using namespace std

void ReadFile(isstream& in, patient_record& patient_record){

string line;

//read the input stream into the string

getline(in,line);

istringstream iss(line);

iss>>patient_record.room_number;

iss>>patient_record.age;

iss>>patient_record.hospital_wing;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote