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 25th, 2004, 06:46 PM
didaduda didaduda is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 3 didaduda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Need help writing this C++ program PLEASE

<H3 style="MARGIN: auto 0in" align=left>PLEASE help me with this program assignment. I do not understand even how to begin!</H3><H3 style="MARGIN: auto 0in" align=left>The Very Small Bank wants information on how long its customers are waiting for service at drive-in windows. Employees have collected information, which your program will read from a text file. The data consists of the time the customer arrived in hours, minutes and seconds, the time the customer was actually served, and the ID number of the teller. The first digit of the teller ID indicates which branch of the bank was visited, and the next 2 digits identify the teller. The bank is open from 9 AM to 5 PM. You can assume that a customer is always served on the same day he arrives (if not, the bank would go out of business in about a week!). </H3>

Learning Objectives
  • To write a program which requires the manipulation of parallel one-dimensional arrays
  • To read input from a text data file
  • To calculate some commonly used statistics using this data, and draw a histogram


Input


You must download the required data file from the course Blackboard site. The required file is named bankwaits.txt. (SAVED INFO TO PAGE 3 BELOW)

This file contains exactly 47 lines, each containing these items starting in the columns indicated:


Column 1: teller ID (a 3-digit integer)
Column 10: arrival time (as a 6-digit integer; see below)
Column 25: service time (same format as arrival time)

All times are given based on a 24-hour clock, with no colons. For example, 1:02:01 PM is represented in the data file as 130201. You that there are exactly 47 lines in the input file, and that all data is present, valid, and correctly formatted

Processing

Your program must read in all input data, then use it to calculate each wait time in seconds (an integer), the mean wait time (a real), the standard deviation of the wait times (real), the shortest and longest wait times (integers), and the range of the wait times (integer). Note all wait time data is to be processed in seconds.

The bank also wants you to assign "Frustration Levels" to wait times as follows, where "mean" is the mean wait time, "wait" is the wait time under consideration, and "SD" is the standard deviation:

Wait Time Frustration Level
--------- -----------------

wait <= (mean - SD) Amazed
(mean - SD) < wait < mean Pleased
mean <= wait < (mean + SD) Calm
(mean + SD) <= wait < (mean + 2*SD) Irritated
(mean + 2*SD) <= wait Berserk

Compute the statistics using these formulas:

mean = (sum of all values) divided by (number of values)

standard deviation = the square root of:
(sum of the squares of the differences between each value and
the mean) divided by (number of values - 1)

range = difference between maximum value and minimum value

Output

The input data, echoprinted in tabular format

The following values, all properly labeled
  • number of data lines in the file
  • mean wait time
  • standard deviation of wait times
  • shortest wait time, longest wait time
  • range of wait times
A histogram (bar graph) showing the frustration level distribution, for example:

Number of Customers

5 10 15
----|----|----|----

Amazed ***********

Pleased ****

Calm ****************

etc....

where each asterisk represents a customer in the category for that row

Use Of Data Structures

You must use parallel one-dimensional arrays as the major data structure on this project. Also, use enumerated types where appropriate.
Data File: bankwaits.txt
707 141251 141659321 090537 090748319 101502 102929222 105702 110000305 114202 115111512 130100 130302407 130100 130619211 134245 134951413 125959 130458419 165952 171012501 164932 165437872 120718 121452872 145441 150000803 090547 091148101 105213 105645136 145757 145959982 120202 120833619 140946 141431913 093031 093745654 093000 093630217 091537 092745101 090000 090005247 105702 110601172 150030 150400247 153017 153422631 115502 115801737 112807 113208602 120708 121625902 114517 115102602 165959 170859803 145441 145451631 134233 134734111 102117 102747803 151515 151559102 112049 112552114 094500 095000345 160102 160544333 102030 102502757 141252 141932101 090000 090417727 151822 152305515 122048 122417502 090102 090400767 163037 163511603 121011 123035851 165700 170902545 165502 170001










Reply With Quote
  #2  
Old March 26th, 2004, 11:17 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
I charge $150 an hour for doing homework. As I'm not a whiz at C++, I'd give you a discount, though -- $125 an hour, 10-hour minimum.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old March 27th, 2004, 02:15 AM
bobert bobert is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Colorado, USA
Posts: 15 bobert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 sec
Reputation Power: 0
I'll do it for $120/hour. :-)

bobert

Reply With Quote
  #4  
Old March 28th, 2004, 12:44 PM
didaduda didaduda is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 3 didaduda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How many hours?

Quote:
Originally Posted by bobert
I'll do it for $120/hour. :-)

bobert

Wow! How many hours will it take? PLEASE contact me back asap. email is didaduda@gtcom.net

Reply With Quote
  #5  
Old March 28th, 2004, 12:56 PM
didaduda didaduda is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 3 didaduda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How many hours? How long does it take to write a C++ program? Please respond asap. THanks,

Reply With Quote
  #6  
Old March 28th, 2004, 09:40 PM
yanivn yanivn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 4 yanivn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation HomeWork solver

Quote:
Originally Posted by didaduda
How many hours? How long does it take to write a C++ program? Please respond asap. THanks,
Leave a message if you are intested, with your email, i will be glad to help

Last edited by yanivn : March 28th, 2004 at 09:44 PM. Reason: oopsi

Reply With Quote
  #7  
Old February 11th, 2005, 08:16 AM
mcciysm3 mcciysm3 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 mcciysm3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m
Reputation Power: 0
tyr this website; www.glenmccl.com/005.htm, it has basics for the code for mean and standard deviation if youre still stuck

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Need help writing this C++ program PLEASE


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 6 hosted by Hostway
Stay green...Green IT