| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Project help
im doning a project and im stuck i have no idea what to do next and how to go about doing it.
-------------------------------------------------------------- The project is this: There are fifteen sets of rating-time pairs. The actual contents of the file begin like this Fishhawk, Skyler 5 44 1 24 4 48 3 36 4 60 3 48 1 20 2 40 5 48 and 6 more Doonesbury, Mike 1 20 1 20 4 36 2 32 7 60 3 52 9 84 8 68 8 76 and 6 more Canyon, Steve 1 28 4 44 6 56 7 80 5 76 3 60 1 36 2 52 5 60 and 6 more You are to write a program that does the following: 1. Calculates the efficiency number for each patient treated. This is calculated as 2.0 * time / log (rating + 1) where log is the natural logarithm. For example, Skyler Fishhawk's first patient results in a efficiency number of 2*44 / log(5+1) or 49.114 which is very good. The lower the efficiency number, the more efficient the doctor is. 2. Calculates the average efficiency number for each doctor (the average for the 15 patients). 3. Calculates the worst patient treatment for each doctor (the highest efficiency number that the doctor had for any of his/her 15 patients). 4. For each doctor, displays the doctor's name (in the form FirstName LastName with no comma), the average efficiency number for the doctor, and the doctor's worst efficiency number. This display should show all information in neat columns. Efficiency information should be shown with three decimal places. Here is a sample for the first few doctors: Doctor Average Worst Skyler Fishhawk 62.278 86.335 Mike Doonesbury 59.500 80.791 Steve Canyon 68.491 103.874 5. Determine the name of the doctor with the best (lowest) average efficiency number and display this name with that doctor's average. 6. Determine the name of the doctor with the overall worst single patient treatment (highest single patient efficiency number) and display the name and the worst efficiency number for that doctor. 7. Determine and display the average efficiency number for all doctors, all patients combined. Actions #1, #2, and #3 must be performed in a void function named EvaluateDoctor. The function may perform additional actions; but it must do #1, #2, and #3 for one doctor. This will make it possible to invoke EvaluateDoctor for each doctor. --------------------------------------------------------- This is what i have so far #include<iostream> #include<iomanip> #include<fstream> #include<cmath> #include<string> using namespace std; int main() { ifstream inFile; string line; string lastName; string firstName; inFile.open("efficiency.txt"); while (! inFile.eof() ) { getline (inFile,line); cout << line << endl; } inFile.close(); return 0; } -------------------------------------------------------- Help would be appreciated |
|
#2
|
|||
|
|||
|
Before jumping to implementation first jot down an algorithm.Then follow it.If you expect the forum to do your work what will you do??
First write algos and if you do not find them correct then discuss with us but asking to do work is not alowed by the regulations of this forum. Best Wishes. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Project help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|