Assignment #4:

You can earn a maximum grade of B (89%) on this assignment if your program generates 100 pseudorandom integers then stores those 100 values into a one-dimensional array. The program must then search for the largest odd integer in the array and display that value along with its position within the original array (where the very first integer is considered to be in position zero.)

If you wish to earn a maximum grade of an A (100%), then your program must generate 100 pseudorandom integers and store those 100 values into a one-dimensional array. Then the program must sort the 100 values using any sort algorithm explained in our textbook, studied in this course, or learned from the Web. Finally, your program must display those 100 values in 50 rows with 2 values each, using a tab between each pair of values on the same line. The numbers must be displayed in descending order from left to right (see example below). For example:

321 172
156 45
12 etc.

When your program executes, your name should appear on the very first line so that the instructor can easily identify your program.

Perform your pseudocode before you begin to write the code or type the code into C++. You must follow the Coding Standards so that it is easy to read your program and so that others can understand your code. It is possible to lose many points for violations of these Standards even for a program that executes properly. Be sure to read the common errors that former CMPSC 101 students have made in the past on their programming assignments.

Preconditions:

You must hand in the following on separate pages stapled in this specified order:

  1. The hardcopy source code for this assignment. Staple multiple pages together, if applicable.
  2. The typed pseudocode that you used to write out your C++ code.

    ( No test plan is necessary for this assignment!)

You must also hand in the source file & the executable file on a floppy disk saved as a4.cpp & a4.exe respectively. There should be no other computer files or folders on this floppy disk and the file itself must not be saved in a folder. Use a blank floppy disk and label it with your name, the names of the files, and the name of the course, CMPSC 101. You will lose points if the file is named incorrectly or if the disk is labelled incorrectly. The floppy disk may not be returned to you after this assignment has been graded.