Arrays!    Arrrr…    Chap 4

 

Declare an array of floats called boogerhead.  Let the user intialize them to whatever he wants.  The program should then print out every other element of boogerhead with a row of stars (************) in between, but not before or after the list.   
(10 points)

 

Grade program I:  Enter 10 grades into a grade array.  Print the average score after dropping the lowest one.    (10 pts)

 

Grade program II:  Same as above except the user enters an arbitrary number of scores (without telling the program how many score will be entered).    (5 pts)

 

Grade program III: Create an array of grades in your main, with many repeated grades.  Create a tally array with a subscripted subscript to count the number of each grade scored (see page 233).  Print the results.

 

Baseball:  This program should make use of two arrays:  one to keep track of the number of hits a batter gets each game; and another for the number of at bats in each corresponding game.  (Give the user appropriate prompts.)  Print the overall batting average along with a humorous comment pertaining to the batter's skill level.    (15 pts)

 

Back-words:  Input a word as a character array (string) and print it out backwards.    (5 pts)

 

Code:  Write a program that encodes and decodes words.  The encoding process should bump every letter up by 2 (s becomes u; z becomes b) and add an arbitrary letter to the end of the word.  The decoding process should drop the last letter and decrease every letter by 2.    (15 pts)

 

Bubble sort I: Take an array of ints like  int loco[12] = {4, 7, 14, 8, 3, 19, 35, 26, 19, 43, 11, 72}  and print a sorted, right-justified table as shown below (with underlines and centering).  See page 246.    (20 pts)

            odds                 evens

3                                              4

7                           8

11                      14

           etcetera

 

Bubble sort II:  Problem 4.11 on page 272.    (15 pts)

 

Arr to Func:  Send an array and its size to a function that prints out list of numbers representing the cumulative sum of the array.  Ex:  if the array is {11, 3, 10, 1} the output would be 11, 14, 24, 25.    (15 pts)

 

 

Chess tutorial:  Use a double subscripted array to represent a chess board.  Input the type of piece (king, queen, bishop, knight, or rook) and its location on the board (row, column).  Print stars to show the piece and where that piece can move.  (For simplicity assume that no other pieces might be in the way.)  Use a function for each piece.    (35 pts)