c++ vectors using push_back

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2006
Posts: 3
Reputation: blazinking is an unknown quantity at this point 
Solved Threads: 0
blazinking's Avatar
blazinking blazinking is offline Offline
Newbie Poster

c++ vectors using push_back

 
0
  #1
Aug 1st, 2006
hi all,

I'm new to site {nice work on the forum } and to c++ in general. I've started a class in the subject not to long ago and have hit a snag on one of the programing projects i was asigned to do ... I just cant figure this out ...

basicly i'm buildin a code that'll allow me to take some numbers that a user will enter and spit out the smallest, largest and average of the group. this has to be done using the push_back function that'll insert into vector objects.
Now i've figured out how to calculate average, and how to write the codin for the user to enter the numbers, I just haven't got a clue how i can make the code display the smallest and largest numbers of what the user enters ... i mean how can i make c++ determin which of em is smallest and which is largest ???.
the numbers can be anythin from negative to positve ...

if someone can help me out or point me in a direction of some info for this it be much appreciated ...
"caught ...u... lookin"
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 147
Reputation: Grunt has a spectacular aura about Grunt has a spectacular aura about 
Solved Threads: 12
Grunt's Avatar
Grunt Grunt is offline Offline
Junior Poster

Re: c++ vectors using push_back

 
1
  #2
Aug 1st, 2006
The key to eliminating bugs from your code is learning from your mistakes.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 3
Reputation: blazinking is an unknown quantity at this point 
Solved Threads: 0
blazinking's Avatar
blazinking blazinking is offline Offline
Newbie Poster

Re: c++ vectors using push_back

 
0
  #3
Aug 1st, 2006
thx a bunch that helps
"caught ...u... lookin"
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: c++ vectors using push_back

 
1
  #4
Aug 2nd, 2006
Now i've figured out how to calculate average, and how to write the codin for the user to enter the numbers, I just haven't got a clue how i can make the code display the smallest and largest numbers of what the user enters
I'd bet your prof will want to write your own function to do that.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 3
Reputation: blazinking is an unknown quantity at this point 
Solved Threads: 0
blazinking's Avatar
blazinking blazinking is offline Offline
Newbie Poster

Re: c++ vectors using push_back

 
1
  #5
Aug 2nd, 2006
Originally Posted by iamthwee
I'd bet your prof will want to write your own function to do that.
well yes ofcourse ... and i'm planin on doin that but i just needed a point in the right direction as to how ... been that i never seen it done i needed a refrence to build my own ...
I wouldnt just copy somones work cause thats not me ...
thats one of the reasons y i didnt post up the code cause i didnt need someone to solve this for me i just needed a boost in where to look into ...

anyways thx for the info help it def. was alot more then i expected :mrgreen: ...
Last edited by blazinking; Aug 2nd, 2006 at 10:08 am.
"caught ...u... lookin"
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: c++ vectors using push_back

 
0
  #6
Aug 2nd, 2006
Originally Posted by blazinking
I wouldnt just copy somones work cause thats not me ...
thats one of the reasons y i didnt post up the code cause i didnt need someone to solve this for me i just needed a boost in where to look into ...

anyways thx for the info help it def. was alot more then i expected :mrgreen: ...
You've got the correct attitude. :cheesy:
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC