| | |
Help Would Be Appreciated
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 47
Reputation:
Solved Threads: 0
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.
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.
>>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.
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.
Start here
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.
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int main() { // put your code here }
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.
"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. C++ Syntax (Toggle Plain Text)
std::string myname; cout << "Enter your name\n"; 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.
•
•
Join Date: Oct 2008
Posts: 47
Reputation:
Solved Threads: 0
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.
>>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.
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.
![]() |
Similar Threads
- Where to begin? Any help is much appreciated! (IT Professionals' Lounge)
- Any help would be greatly appreciated :) (Java)
- Help appreciated on a display problem (Windows 95 / 98 / Me)
- Any help on my dead Satellite A20 would be greatly appreciated! (Troubleshooting Dead Machines)
- Suggestion appreciated. (Promotion and Marketing Plans)
- Help appreciated/required for project (Java)
- Help would be appreciated concerning task manager (Windows NT / 2000 / XP)
- Any help will be greatly appreciated... (Viruses, Spyware and other Nasties)
- NEW Site: Feedback Greatly Appreciated (Website Reviews)
- An Interesting Evolution of Problems, Suggestions Appreciated (Troubleshooting Dead Machines)
Other Threads in the C++ Forum
- Previous Thread: How do i read a huge file of data from a text file in c++?
- Next Thread: Saving STL Maps to file as Binary(Possible?)
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






