C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 23rd, 2006, 02:12 AM
shakejuhn shakejuhn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 2 shakejuhn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 25 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old March 23rd, 2006, 10:56 PM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 276 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 48 m 58 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Project help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT