Question: #1220

PROG 110 Homework 7 Using Arrays and The Random Number Generator Complete Solution

PROG 110 Homework 7 Using Arrays and The Random Number Generator

Use Assignment Tool
Points Possible: 20
Objective: To use the random number generator to populate a 2D array, using nested for loops, and a foreach loop.
Application Specification:
On the last page, you will see an example of the layout required. The data will vary since you will be using the random number generator. Solution Name: yourLastNameArrayHW7
Project Name: yourLastNameHW7
Source File Name: Array2D.cs, Class Name: Array2D


Application Specifications and Requirements:
1. Introduce the user to the program – what is the purpose – and be creative! I don’t want to see “To use the random number generator to populate a 2D arrays, using nested for loops, and a foreach loop” or something similar, and include your name (5 points).
2. When displaying the table use a title appropirate for your purpose. “Table” is not appropriate, be more specific to your application, be creative and have some fun.
3. Display the array data in a table format
4. Display the accumulated sum and the caclucated average.
5. Prompt the user to “Would you like to see another table?” and have your program execute accordingly. The user may respond with lower or uppercase text, and you need to explain to the user what to type.
6. Let the user know when the program has ended and what to do next.
7. Follow efficient programming techniques.
Requirements:
1. Make sure to include the file block comments and internal documentation.
2. Delcare all local variables at the beginning of the method.
3. Declare a constant ROWS equal to 10 and COLS equal to 5, MAX equal to 100
4. Declare an integer 2-d array named numbers of size ROWS, COLS
5. Create a Random object named rand
6. Use nested for loops to assign a random number to an element in the 2-d array
 Make the random number range from 1 through 100 inclusive. (this means that values displayed will be 1 through 100; use the constant MAX)
 Here is a website to explain the Next method and the arguments required. http://msdn.microsoft.com/en-us/library/2dx6wyd4.aspx and review the videos posted about the randon number generator.
8. Use a separate foreach loop to calculate the total, and store it in a variable. Don’t display the results just yet.
9. Calculate the average and store it in a variable. Don’t display the results just yet.
10. Display the title of the table data.
11. In another separate looping construct, using nested ‘for’ loops, display the 2-d array in its rows and columns. Right align the numbers in each column.
12. Display the accmulated sum with 0 decimal places and commas when appropriate and the average with 2 decimal places and commas when appropriate. Use the character format specifiers within the placeholders. In otherwords, for this display, do not use the ToString method.
Review the Software Development Standards (SDS) for implementing the required documentation, naming conventions, UI, indentation of the loops, and other details.
Hint:
See page 218 of your textbook
Follow this Layout:
Note: the picture is embedded within this document and is not displayed on the output console.
Time Sheet Requirement
1. No memo is required for this assignment,
1. The complete Visual Studio solution you developed.
2. Submit all files in one Zip file named yourLastNameHW7 (e.g. SmithHW7.zip).
The zip file hierarchy will look like the following:
SmithHW7.zip
SmithArrayHW7
It is your responsibility to ensure that all files are submitted and that I don’t receive a “shortcut”, or missing a file. If I don’t have the correct files, I cannot grade your project and therefore, you will receive a zero for the assignment.
If you have questions, please post in the appropriate category/topic, but do not post any actual code. In answering another student’s question, do not post actual code, but you may provide guidelines/hints on how to obtain the desired result.

Solution: #1217

PROG 110 Homework 7 Using Arrays and The Random Number Generator Complete Solution

This Tutorial is rated A+ p...

Tutormaster
Rating: A+ Purchased: 11 x Posted By: Vikas
Comments
Posted by: Vikas

Online Users