Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main(){
- //Initialize Required Variables For Program
- int patientCount = 0;
- string id;
- int avg = 0;
- int howMany = 0;
- ifstream reader ("data.txt"); //Open The Data File To Be Read From
- while( reader >> id && reader >> howMany ){ //as long as you can read another pacient data
- int sum = 0; //sum accumulates the pressure readings per pacient
- cout << "The Patient ID Is: " << id << endl;
- cout << "The Number Of Blood Pressure Record This Patient Has Is: " << howMany << endl;
- for(int K = 0; K < howMany; ++K){
- int number;
- reader >> number;
- sum += number;
- }
- //going to complete average here but I don't know how to pull out the data
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement