Help Would Be Appreciated

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2008
Posts: 47
Reputation: joed13k1941 is an unknown quantity at this point 
Solved Threads: 0
joed13k1941 joed13k1941 is offline Offline
Light Poster

Help Would Be Appreciated

 
0
  #1
Oct 8th, 2008
Anyone know how to accomplish this task on visual studio with C++?

Write a program that reads a series of numbers (doubles) from the user, then prints the mean and the
range.
Notes:
• You do not know ahead of time how many numbers will be in the list.
• When you want to stop entering numbers, enter control‐Z.
• The range is the difference between the lowest and the highest number.
• The numbers will be in the range of 0.0 to 100.0. Ignore any numbers outside of this range.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,358
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1464
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Help Would Be Appreciated

 
0
  #2
Oct 8th, 2008
>>Anyone know how to accomplish this task on visual studio with C++?
Yes. Do you? Hint: start out the program very simply and prompt for input. When that is done put that in a loop. Compile and correct all errors again. After that, add code to implement the rest of the requirements.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 47
Reputation: joed13k1941 is an unknown quantity at this point 
Solved Threads: 0
joed13k1941 joed13k1941 is offline Offline
Light Poster

Re: Help Would Be Appreciated

 
0
  #3
Oct 8th, 2008
No. I definitely do not know how to do it. I will try my best with your given advice and post my results later. Thanks again Ancient Dragon!
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,358
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1464
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Help Would Be Appreciated

 
0
  #4
Oct 8th, 2008
>>No. I definitely do not know how to do it
That's why you are in school -- to learn how
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 47
Reputation: joed13k1941 is an unknown quantity at this point 
Solved Threads: 0
joed13k1941 joed13k1941 is offline Offline
Light Poster

Re: Help Would Be Appreciated

 
0
  #5
Oct 8th, 2008
Ok. I honestly have no idea where to begin. I seem to be having a mental block. Any help would be greatly appreciated.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,358
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1464
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Help Would Be Appreciated

 
0
  #6
Oct 8th, 2008
Start here
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. // put your code here
  7.  
  8. }

Re-read my previous post #2 and code one sentence at a time. Code the line that displays the prompt. Get that to work and compile, then code another line that asks for user input.

Have you read your textbook and done the example programs at the end of each chapter? If not, then you should do that.
Last edited by Ancient Dragon; Oct 8th, 2008 at 8:47 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 47
Reputation: joed13k1941 is an unknown quantity at this point 
Solved Threads: 0
joed13k1941 joed13k1941 is offline Offline
Light Poster

Re: Help Would Be Appreciated

 
0
  #7
Oct 8th, 2008
Ok. I have been trying. I am unsure of how to prompt the user to give input without asking a question or entering a statement. This is the 17th assignment and I have been breezing through until now. Can someone please get me started so I can visually see what to do?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,358
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1464
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Help Would Be Appreciated

 
0
  #8
Oct 8th, 2008
"to prompt" just smply means use cout to display the message cout << "Enter something\n"; and to get input for a string. You need to STUDY YOUR TEXTBOOK for other variations of cin and cout.

  1. std::string myname;
  2. cout << "Enter your name\n";
  3. getline(cin, myname);
Last edited by Ancient Dragon; Oct 8th, 2008 at 10:19 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 47
Reputation: joed13k1941 is an unknown quantity at this point 
Solved Threads: 0
joed13k1941 joed13k1941 is offline Offline
Light Poster

Re: Help Would Be Appreciated

 
0
  #9
Oct 8th, 2008
There is no textbook. There are some readings online for class but they are no help. We are given these assignments and are not even taught how to do them. Like I said, I have been having no trouble at all until now. We were not taught how to take infinite values until the user enters ctrl-Z. I really am trying hard to do this. I am completely stumped.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,358
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1464
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Help Would Be Appreciated

 
0
  #10
Oct 8th, 2008
>>There is no textbook.
What the hell Are you doing this in some sort of school ? or learning c++ all on your own? I assumed you were in school, but maybe I was wrong.


What part(s) of the assignment don't you know how to do. cin or cout , or something else

I'm sorry, but we can't give you a complete course in c++. If you are on your own then I'd strongly suggest you spend some $$$ and buy a good c++ book that will teach you.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
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