This is a discussion on URGENT: filling and array/functions/loops within the C and C++ forums, part of the Programming Talk category; Heyy can some one please tell me how to do this ASAP? I will reallyyy appreciate it..Thank You!! =) Display ...
|
|||||||
|
|||
|
Heyy can some one please tell me how to do this ASAP?
I will reallyyy appreciate it..Thank You!! =) Display the following: 1. Enter Data 2. Compute and Display Statistics 3. Quit the program 3) WHILE the user hasn't entered anything keep looping. Once the user enters either a 1, 2 or a 3 drop into that particular section of code. Meaning you will have 4 IF statements, if the person enters 1, let them enter the data. If they enter 2, check that you already have some data in memory - if you dont ask the user to enter data. If they enter 3, quit the program. If they enter ANYTHING else that isn't 1 or 2 or 3 remind them what the valid options are. 3a) IF the user entered 1: initialize your integer array to all zeroes. start getting data from the user one Integer at a time. you should also have some "control" character used to abort entry. I like to use "q" that is: WHILE (we dont have more than 50 Integers in the array OR the user hasn't entered a "q") keep getting data from the user at this point it would be a good idea to keep track of how many numbers were entered, for use in (3b) 3b) IF the user entered 2: Do the required mathematical computations. remember the user CAN enter a 0. so keeping track of how many numbers the user ACTUALLY entered is useful, because your array initially contained 0's. imagine this... the user enters a 1, a 0 and a 5. if your program quit here just because it saw a 0 your data analysis would be incorrect. you should know 3 numbers were entered and do analysis on them. 3c) quit! 3d) stay in the while loop, but print a line to remind the user what the correct options are |
| Sponsored Links |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Anybody having TCS 9th july paper.....its urgent! | luvureet | Placement Papers | 1 | 07-14-2005 03:00 AM |
| Anybody having TCS 9th july paper.....its urgent! | luvureet | Interview Questions | 0 | 07-13-2005 05:13 AM |
| plz help ...its urgent | luvureet | Interview Questions | 1 | 06-15-2005 08:42 AM |
| Urgent Requirement for Java/.NET Architects/Business Analysts/Telecom profession | kalareddy | Experienced Job Seekers - India | 0 | 05-23-2005 06:41 PM |
| Urgent opening for Jr Developers for a leading IT company. | techguru | Freshers Jobs | 0 | 05-23-2005 06:57 AM |