There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
unlimited


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
chris200x9's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2006
03-Oct-2007, 10:36 PM #1
unlimited
hi I'm taking intro c++ and my teacher gave me a homework problem


(a) An account executive must keep track of her expenses on a business trip. Write a C++
program named assign4d.cpp that totals the executive’s expenses. The total expense
amount is the sum spent on tolls, parking, meals, hotel accommodations, and enter-
tainment. Furthermore, the number of miles driven * 0.30 cents is also added to the
cost. The program should prompt the user for the relevant information and display the
individual and total expenses to the user.
(b) Write a new C++ program named assign4e.cpp that expands on the program you de-
veloped in the first part. The new program should accommodate multiple (unlimited)
salespeople. It should gather the relevant information for each executive and once all
data is entered, it should display the average and total expenditures for each category.


I know how do to prt a..but I am stumped on how to make it accomadate unlimited people?


any ideas and help would be gretly appreciated .
mt2002's Avatar
Computer Specs
Senior Member with 573 posts.
 
Join Date: Sep 2005
Location: 127.0.0.1
Experience: Advanced
07-Oct-2007, 07:33 PM #2
Hello,

I am guessing a list that can grow or shrink in size depending on the number of people. If this is so, the STL would be great here... More specifically, std::vector<>, which acts as a templated linked list structure.

If you cannot use the STL (for some reason), then you can impliment it as a linked list.
__________________

"Within C++, there is a much smaller and cleaner language struggling to get out." - Bjarne Stroustrup
Work: Tech Support, Programmer; A+ 220-602 Certified
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:27 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.