QuestionQuestion

Assignment #17
Write a program that generates 15 random values (between 1 and 100) and stores them into an array. The program should then display all the values stored in the array and then display only the largest and smallest values stored in the array. You can use the functions in chapter 7. Create an IPO or pseudo code and include it in with your source code and output.

Assignment #18
An instructor has 5 students who have taken 5 tests each. They use the following grading scale to assign letter grades based on the student’s average test score:

Test score    Letter grade
90-100                   A
80-89                     B
70-79                     C
60-69                     D
0-59                      F
Write a program the uses an array of string objects to hold the 5 student names, and array of 5 characters to hold the students letter grades and 5 arrays of 5 doubles each to hold each student’s test scores.
The program should allow the user to enter each student’s name and their 5 test scores. It should then calculate and display each student’s average test score and a letter grade based on the average.
Include an IPO or pseudo code along with you source code and output for full credit.

Assignment #19
Modify Assignment #18 so it drops each student’s lowest score when determining the students’ test score average and Letter grade.
No scores less than 0 or greater than 100 should be accepted.

Assignment #20
Magic 8 ball
Write a program that simulates a Magic 8 Ball, which is a fortune telling toy that displays random answers to yes or no questions. Place the following list of 12 responses from the 8_Ball_responses.txt file into an array or vector. It should prompt the user to ask a yes or no question and then display one of the responses, randomly selected from the array or vector. The program should repeat until the user is ready to quit.
Note: the index should be a randomly generated as a value between 0 and 11 to accommodate each of the 12 possible answers.
An IPO or pseudo code, soource code and several outputs are required for full credit.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

/*
    Pseudocode (algorithm) for main function:

    Declare size of the array and set it to 15
    Declare array of 15 integers
    Declare variables for largest and smallest value
    Initialize the random generator
    Call fillArray to fill the array with random values
    Call printArray to print the array values
    Call getLargest and store the value to the variable
    Call getSmallest and store the value to the variable
    Print the largest value
    Print the smallest value

    Pseudocode (Algorithm) for fillArray function:
    Inputs: array (array of integers), size (integer)

    For each element of the array:
       element = random number % 100 + 1

    Pseudocode (Algorithm) for printArray function:
    Inputs: array (array of integers), size (integer)

    Print the info message
    For each element of the array:
       Print the element
       Print a space character
    Print a new line

    Pseudocode (Algorithm) for getLargest function:
    Inputs: array (array of integers), size (integer)

    Declare variable for the highest value
    Assign the first element of the array to the highest value
    For each element of the array except the first:
       If the element is greater than the highest value:
            highest value = element
    Return the highest value

    Pseudocode (Algorithm) for getSmallest function:
    Inputs: array (array of integers), size (integer)

    Declare variable for the lowest value
    Assign the first element of the array to the lowest value
    For each element of the array except the first:
       If the element is less than the lowest value:
            lowest value = element
    Return the lowest value
*/
#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

void fillArray(int array[], int size) {
    for(int i = 0; i < size; i++) {
       array[i] = rand() % 100 + 1;
    }
}...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

50% discount

Hours
Minutes
Seconds
$45.00 $22.50
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats