المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ارجوووكم ساعدوووووووووني ياعباقره



FATI_1
26-05-2004, 11:32 PM
Problem:

Design a program that will ask the user to enter six numbers to an array and display the following through a main menu:

a: The numbers enterd

b: The largest and smallest number enterd

c: The sum and avarage of the numbers enterd

d: The histogram of numbers enterd

e: The sorted numbers enterd



Task1 Prepare a program documentation.

This documentation covers the technical design of the given problem.

Design an alogorithm (pseudocode or flowchart) of the given problem. You break the program into pieces by designing a solution on each task. (ex. Solution on how to sort array solution on getting thr largest and smallest numbers enterd)

Task 2 Code the program.

Code the solution using C++ program. Include simple documentation in your code using the COMMENT function of the program. Apply indentations for program readability.

Task 3 Test the program.

Test the program against the given data

-------------------------------------------------------------------------------------------------------------------------------------

Test data:

1:

===========================

Main Menu

1: Input Array

2: Display Array

3: Find Max and Min

4: Find Sum

5: Histogram

6: Sort (Ascending) Array

7: Quit

Enter your choice:

=============================

----------------------------------------------------------------------------

2:

=============================

Input Array

Enter 6 numbers to an array

9

2

4

9

6

7

Press any key to go back to Main Menu!

===============================

---------------------------------------------------------------------------

3:

===============================

Display Array

9 2 4 9 6 7

Press any key to go back to Main Menu!

Press any key to go back to Main Menu!









===============================

------------------------------------------------------------------------------

3:

===============================

Find Max and Min

9 2 4 9 6 7

The largest number is 9

The smllest number is 2

Press any key to go back to Main Menu!



================================

---------------------------------------------------------------------------------------

4:

================================

Find Sum and Average

9 2 4 9 6 7

The sum is 37

The average is 6.17

Press any key to go back to Main Menu!

=================================

-----------------------------------------------------------------------------------------------------

5:

=================================

Histogram

Element Value Graph

0 9 *********

1 2 **

2 4 ****

3 9 *********

4 6 ******

5 7 *******

Press any key to go back to Main Menu!

==================================

-----------------------------------------------------------------------------------------------------

6:

==================================

Sory(Ascending)Array

Data utems in original order:

9 2 4 9 6 7

Data items in ascending order:

2 4 6 7 9 9

Press any key to go back to Main Menu!

===================================