Question

In: Computer Science

For this assignment, write a program that will calculate the quiz average for a student in...

For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array.

For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores).

It is recommended that this program be written in two versions. The first version of the program will read a set of quiz scores from standard input (the keyboard), as has been done since the start of the semester. The second version of the program will alter the first version so that the program reads from an input file, rather than standard input. The second version is the only one that will be handed in for grading.

Version 1

As mentioned above, this version of the program will read the set of quiz scores from standard input. A quiz score of -1 will signal the end data.

NOTE: all of the functions mentioned in this logic are described below.

Declare an array of integers and an integer variable to hold the number of quizzes that have been completed. If any other variables are needed, those should also be declared.

Fill the array by calling the buildQuizArray() function. The buildQuizArray() function returns the number of quiz scores that it read. This returned value should be saved in the the integer variable that holds the number of quizzes that have been completed.

Call the calcQuizAverage() function to calculate the student's quiz average. The calculated quiz average that is returned from the calcQuizAverage() function should be displayed with 2 digits after the decimal point and an appropriate label.

Display the student's quiz scores by calling the printQuizArray() function. Use a title such as "Quiz Scores".

Functions to write and use

Write and use the following 5 functions in the program.

int buildQuizArray( int quizArray[] )

This function will fill the array with the quiz scores.

It takes as its arguments an array of integers that will hold the quiz scores. It returns an integer that is equal to the number of quiz scores that were read. Note about the return value: this value is important because it's possible that the student has not completed the semester and therefore has not taken all 12 quizzes yet.

The function should start by declaring any variables that are needed. At a minimum, there should be two integers: a subscript and another to hold the quiz score that is entered by the user.

Initialize the subscript to the beginning of the array.

Get the first quiz score from the user. Make sure to indicate that a quiz score of -1 will end the input.

In a loop that will execute as long as the quiz score is not -1, put the quiz score into the array at the subscript position, increment the subscript to the next spot in the array, and get the next quiz score from the user.

Finally, return the number of quizzes that were placed in the array (think about the subscript).

void printQuizArray( string title, int quizArray[], int numberOfQuizzes )

This function will display the information for the quizzes that have been completed.

It takes three arguments: the first argument is a string that holds the title for the report that is being displayed, the second argument is an array of integers that holds the quiz scores, and the third argument is an integer that holds the number of quiz scores in the array.

It returns nothing.

The function should first display the string argument followed by a line of dashes on the next line.

In a loop that executes numberOfQuizzes number of times, display the quiz number and quiz score out of 10 points.

Use the following as a basic format for the output (this assumes that the string argument holds "Quiz Scores" and that numberOfQuizzes holds the value 5):

Quiz Scores
----------------
Quiz 1: 4/10
Quiz 2: 10/10
Quiz 3: 5/10
Quiz 4: 10/10
Quiz 5: 8/10
double calcQuizAverage( int quizArray[], int numberOfQuizzes )

This function will calculate a student's quiz average.

It takes two arguments: the first argument is an array of integers that holds the quiz scores, and the second argument is an integer that holds the number of quiz scores in the array.

It returns a double: the calculated quiz average.

The function should start by executing a loop that will calculate the sum of the quiz scores in the array.

If the student has taken more than two quizzes, the quiz average is calculated as follows (NOTE: the formula is long. Make sure you're getting the entire formula):

(sum of quiz scores - sum of 2 lowest quiz scores) / (10 * (number of quizzes - 2)) * 100
Notice that the sum of the two lowest quiz scores is part of the formula. This sum can easily be found by sorting the quiz scores in ascending order and then adding up the values at positions [0] and [1] of the array. However, avoid changing the array argument that is passed to the function because the order that the quiz scores were entered by the user must be maintained. Instead, create an array of twelve integers and call the copyArray() function that is described below to copy the original values from the array argument into the new array. Call the sortArray() function to sort the new array and then calculate the sum of the two lowest quiz scores using the new array.

If the student has taken two quizzes or fewer, the quiz average is calculated as follows:

sum of quiz scores / (10 * number of quizzes) * 100
Once the quiz average has been calculated, it should be returned.

void sortArray( int array[], int numberOfQuizzes )

This function will use the selection sort algorithm that was presented in lecture to sort the array in ASCENDING order.

It takes two arguments: the first argument is an array of integers that holds the quiz scores, and the second argument is an integer that holds the number of quiz scores in the array.

It returns nothing.

void copyArray( int destination[], int source[], int numberOfValues )

This function will copy a specific number of values from one array into another array.

It takes three arguments: the first argument is an array of integers that values will be copied into, the second argument is an array of integers that values will be copied from, and the third argument is an integer that holds the number of values to be copied.

It returns nothing.

In a loop that executes numberOfValues number of times, copy a value from the source array into the corresponding location in the destination array.

Version 1 Program Requirements:

The array should be able to hold 12 elements. Use a symbolic constant to represent the maximum size of the array.

The array has the capability to hold 12 elements, however, that does not mean that it will all be used. This is the reason that the number of elements in the array is being passed to the printQuizArray, calcQuizAverage, sortArray, and copyArray functions. This value is the return value from buildQuizArray.

Version 1 Output:

Run 1

Enter your score for quiz 1 (-1 to quit): 10
Enter your score for quiz 2 (-1 to quit): 0
Enter your score for quiz 3 (-1 to quit): 8
Enter your score for quiz 4 (-1 to quit): 6
Enter your score for quiz 5 (-1 to quit): 9
Enter your score for quiz 6 (-1 to quit): -1

Your quiz average is 90.00%

Quiz Scores
----------------
Quiz 1: 10/10
Quiz 2: 0/10
Quiz 3: 8/10
Quiz 4: 6/10
Quiz 5: 9/10
Run 2

Enter your score for quiz 1 (-1 to quit): 6
Enter your score for quiz 2 (-1 to quit): 7
Enter your score for quiz 3 (-1 to quit): -1

Your quiz average is 65.00%

Quiz Scores
----------------
Quiz 1: 6/10
Quiz 2: 7/10
Run 3

Enter your score for quiz 1 (-1 to quit): 10
Enter your score for quiz 2 (-1 to quit): 10
Enter your score for quiz 3 (-1 to quit): 0
Enter your score for quiz 4 (-1 to quit): 6
Enter your score for quiz 5 (-1 to quit): 7
Enter your score for quiz 6 (-1 to quit): 8
Enter your score for quiz 7 (-1 to quit): 6
Enter your score for quiz 8 (-1 to quit): 0
Enter your score for quiz 9 (-1 to quit): 10
Enter your score for quiz 10 (-1 to quit): 8
Enter your score for quiz 11 (-1 to quit): 10
Enter your score for quiz 12 (-1 to quit): 8
Enter your score for quiz 13 (-1 to quit): -1

Your quiz average is 83.00%

Quiz Scores
----------------
Quiz 1: 10/10
Quiz 2: 10/10
Quiz 3: 0/10
Quiz 4: 6/10
Quiz 5: 7/10
Quiz 6: 8/10
Quiz 7: 6/10
Quiz 8: 0/10
Quiz 9: 10/10
Quiz 10: 8/10
Quiz 11: 10/10
Quiz 12: 8/10
Version 2

This is the version of the program that will be submitted for grading. It does the same thing as Version 1 of the program, but the data will be read from an input file rather than standard input.

The majority of the changes for this version of the program will be made in the buildQuizArray function. The two changes that are not in buildQuizArray are to add #include <fstream> and #include <cstdlib> to the top of the code. The #includes are needed so that files can be used in the program.

Input File

The input for this version of the program will be read from a file named quizscores.txt. The file consists of a set of records that contain the quiz score that a student earned on a quiz in CSCI 240. Each record represents one quiz. The file resembles the following:

10
0
8
6
9
Changes to buildQuizArray

Add a declaration for an input file stream to the variable declarations within buildQuizArray. For example:

ifstream infile;
Before getting the first quiz score from the user, open the input file. This will connect a variable in the program with the file of quiz scores.

infile.open( "quizscores.txt" );
The open statement will open a file named quizscores.txt.

Windows Users: the quizscores.txt file MUST be located in the same directory as the CPP file.

Mac Users: there are two options available to handle the input file.

Option 1: put in the set of double quotes ("") between the parenthesis for the open command, find where the file has been saved on your Mac, and then drag and drop the file in between the quotes. It should place the name of the file, including the complete path of where it is located on your Mac, between the quotes. If you use this option, before handing in the CPP file, remove the path name from the file name so that it only has quizscores.txt between the double quotes.

Option 2: Build the Program one time. In the Project Navigator (it's on the left side of the screen on my version of XCode), there should be two folders: one with the name of the project and another with the name Products. Click on the Products folder. There should be a file with the name of the project. Click on the file in the Products folder. In the File Inspector (it's on the right side of the screen on my version of XCode), there should be a "Full Path" label that is followed by the complete path where the executable for the project will be saved. Open this path in Finder by clicking on the small arrow after the path name. Put the quizscores.txt file in the location that opens in Finder. If you use this option, the open statement can be used as shown above.

Once the file has been opened, make sure that it opened correctly. This is an important step because a file cannot be processed if it doesn't exist or open correctly. To test if the file opened correctly:

if ( infile.fail() )
{
cout << "The quizscores.txt input file did not open";
exit(-1);
}
In version 1 of the program, cin was used to get data from standard input (the keyboard). Since this version of the program is reading input from a file rather than standard input, substitute the name of the input file stream (infile in the example above) in place of cin. The cout statements that display a prompt for the user are not needed with the data being read from a file.

If version 1 of the program had something like:

cout << "Enter the quiz score (-1 to quit): ";
cin >> num;
  
In version 2 of the program, it should now be:

infile >> num;
The input file does not have a quiz score -1 to indicate the end of data. Instead, the loop should test to see if there is data in the file. One way to do this is to use the input file stream variable as a boolean variable:

while( infile )
As long as there is information in the file, the input file stream variable will remain valid (or true). Once the end of the data has been reached, the stream will become invalid (or false). Note: this test is only successful AFTER an attempt has been made to read data from the file. This means that a standard read loop pattern with a priming and secondary read should be followed.

Finally, once all the data has been read from the file, the file should be closed. This should be placed after the closing curly brace for the loop but before the return statement for the function. To do this, execute the following:

infile.close();
Version 2 Output

The output that is produced with the quizscores.txt input file:

Your quiz average is 87.00%

Quiz Scores
----------------
Quiz 1: 9/10
Quiz 2: 10/10
Quiz 3: 10/10
Quiz 4: 9/10
Quiz 5: 0/10
Quiz 6: 4/10
Quiz 7: 10/10
Quiz 8: 8/10
Quiz 9: 10/10
Quiz 10: 0/10
Quiz 11: 7/10
Quiz 12: 10/10
Version 2 Program Requirements:

Add #include <fstream> and #include <cstdlib> at the top of the program.

Copy the input file and write the program so that it reads the data from the current directory (ie. don't specify a file path).

As with program 6, each of the functions MUST have a documentation box that describes the function. This is the last reminder about function documentation that will appear in the assignment write-ups.

Solutions

Expert Solution

PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU

# include <iostream>
# include <climits>
# include <string> 
# include <iomanip>
# define MAX_SIZE 12
using namespace std;


/***************************************************************
Function: int buildQuizArray ()

Use: This function takes the input from the user and fill it 
     in the quizArray()

Argument: an integer array : the array holds the scores of 
                  the quizzes. 

Returns: integer : denoting the size of the integer array 
                                   quizArray()

Note: We have used a while loop which will break when the user
          inputs -1.
***************************************************************/
int buildQuizArray (int quizArray[]) {
                
        // initialize the subscript to the beginning of the array
        int subscript = 0;

        // this variable will hold the quizScore
        int quizScore = 0;
        cout << "\n";

        // take input the quizScore from keyboard
        // do this (indefinitely) until -1 is encountered
        while (true) {
                // prompt the user for the quiz score
                // as subscript indicates the index
                // for quiz number, we will print (subscript + 1)
                cout << "Enter your score for quiz " << subscript + 1 << " (-1 to quit): ";

                // take the input from keyboard
                cin >> quizScore;

                // if -1 is entered, we will return
                // break out of the loop
                if (quizScore == -1) {
                        break;
                }

                // fill the score into the array
                quizArray[subscript] = quizScore;

                // increment the subscript
                subscript += 1;
        }

        // as the subscript variable contains the 
        // index of the next block, its value will be equal
        // to the size of the array
        return subscript;
}



/***************************************************************
Function: void printQuizArray()

Use: Prints the array of scores the student got in quizzes.

Argument: string : a title which says - "Quiz Scores"
                  integer array : containing the scores of the quizzes
                  integer : containing the number of elements in the array

Returns: Nothing.

Note: None.
***************************************************************/
void printQuizArray (string title, int quizArray[], int numberOfQuizzes) {
                
        cout << "\n" << title;
        cout << "\n------------------";

        for (int i = 0; i < numberOfQuizzes; ++i) {
                // as the subscript starts from 0, 
                // while printing, we will add 1 to it
                cout << "\nQuiz " << i + 1 << "\t" << quizArray[i] << "/10";
        }

        cout << "\n\n";
}

/***************************************************************
Function: void copyArray()

Use: Copies the elements of the source array into destination
         array.

Argument: integer array : destination array in which copying has 
                                                  to be done
                  integer array : source array from which copying has 
                                                  to be done
                  integer : containing the number of elements in the array

Returns: Nothing.

Note: None.
***************************************************************/
void copyArray (int destination[], int source[], int numberOfValues) {
                
        // copying the elements of source in destination
        for (int i = 0; i < numberOfValues; ++i) {
                destination[i] = source[i];
        }
}


/***************************************************************
Function: void sortArray()

Use: Sorts the input array given as an argument. 

Argument: integer array : whose elements need to be sorted in 
                                                  ascending order.
                  integer : containing the number of elements in the array

Returns: Nothing.

Note: We have employed Selection Sort to sort the elements.
***************************************************************/
void sortArray (int array[], int numberOfQuizzes) {
                
        // selection sort
        // 1. Pick an element from the start
        // 2. find the position of the minimum element
        // 3. replace the picked element with the minimum element
        // 4. Do this for all the elements 

        // we will run our loop for numberOfQuizzes - 1 elements
        // because, after this, the last element will automatically
        // be on its correct position
        for (int i = 0; i < numberOfQuizzes - 1; ++i) {
                        
                int minIndex = i;

                // find the minimum element in the array right to index i
                for (int j = i + 1; j < numberOfQuizzes; ++j) {
                        if (array[j] < array[minIndex]) {
                                minIndex = j;   
                        }
                }

                // swap the minimum element found and the ith element
                swap (array[i], array[minIndex]);
        }
}

/***************************************************************
Function: double calcQuizAverage()

Use: Calculates the average of the integers given according 
         to certain conditions(specified in problem statement). 

Argument: integer array : whose elements need to be sorted in 
                                                  ascending order.
                  integer : containing the number of elements in the array

Returns: double : denoting the average of integers of the array.

Note: The formula used depends on the number of elements in the
          array: 

          1. If the elements are greater than 2, then use: 
                average = (sumOfScores - sumOfTwoLowestQuizzes) / (10 * (numberOfQuizzes - 2)) * 100

          2. If the elements are smaller than or equal to 2, then use:
            average = sumOfScores / (10 * numberOfQuizzes) * 100

***************************************************************/
double calcQuizAverage (int quizArray[], int numberOfQuizzes) {
                
        // sum up the scores of all the quizzes
        int sumOfScores = 0;

        for (int i = 0; i < numberOfQuizzes; ++i) {
                sumOfScores += quizArray[i];
        }

        double average = 0.00;

        // check the number of quizzes

        // if the numberOfQuizzes are greater than 2
        if (numberOfQuizzes > 2) {
                
                // allocate the memory for copy array
                int * newArray = new int [12];

                // copy the contents to the newArray
                copyArray (newArray, quizArray, numberOfQuizzes);

                // sort the new array
                sortArray (newArray, numberOfQuizzes);

                int sumOfTwoLowestQuizzes = newArray[0] + newArray[1];

                // using the formula as mentioned in the problem statement
                average = (double) (sumOfScores - sumOfTwoLowestQuizzes) / (10 * (numberOfQuizzes - 2));
                average *= 100;
        } else {
                average = (double) sumOfScores / (10 * numberOfQuizzes);
                average *= 100;
        }

        return average;
}


/***************************************************************
Function: int main()

Use: Contains the driver code for testing the program. 

Argument: None.

Returns: integer : as a status code. 

Note: None.
***************************************************************/
int main (void) {
                
        // declaring an array of integers with size 12
        int * quizArray = new int [MAX_SIZE];

        // declaring the integer varible 
        // to hold the number of quizzes completed by student
        int numberOfQuizzes = 0;
        
        // calling the buildQuizArray() to get the input
        // this function returns the number of quizzes completed by student
        numberOfQuizzes = buildQuizArray (quizArray);

        // calling the calcQuizAverage() to get the quiz average
        double quizAverage = calcQuizAverage (quizArray, numberOfQuizzes);

        // we are using fixed and setprecision from #include <iomanip> 
        // for displaying the double variable upto 2 decimal places
        cout << "\nYour quiz average is " << fixed << setprecision(2) << quizAverage << "%\n";
        
        // calling the printQuizArray function to print the 
        // students' quiz score
        printQuizArray ("Quiz Scores", quizArray, numberOfQuizzes);

        return 0;
}

Here is the code for version 2 of the code:

# include <iostream>
# include <climits>
# include <string> 
# include <iomanip>
# include <cstdlib>
# include <fstream>
# define MAX_SIZE 12
using namespace std;

/***************************************************************
Function: int buildQuizArray ()

Use: This function takes the input from a file named
         "quizscores.txt" and fill it in the quizArray()

Argument: an integer array : the array holds the scores of 
                  the quizzes. 

Returns: integer : denoting the size of the integer array 
                                   quizArray()

Note: We have used a while loop which will run until the data 
          in the file is not completely read.
***************************************************************/
int buildQuizArray (int quizArray[]) {
                
        // declaration for the input file stream
        ifstream infile;

        // we need to open the file before we can access its contents
        // we will use open () function
        // according to the problem statement, opening the file is to be 
        // done differently for different operating systems
        // you may choose accordingly 

        // the code we are showing here will work in the scenario where
        // the text file is present in the same directory as that of the 
        // cpp file. 

        infile.open ("quizscores.txt");

        // testing the file, that if it has opened correctly
        // according to the problem statement, we will use fail () function for that
        if (infile.fail ()) {
                cout << "the quizscores.txt input file did not open";
                exit (-1);
        }

        // as in this case, we are reading from the file(instead of keyboard)
        // we can't use cin object as it is connected to the standard input
        // in here, we need to replace cin with "infile" ifstream object


        // initialize the subscript to the beginning of the array
        int subscript = 0;

        // this variable will hold the quizScore
        int quizScore = 0;
        cout << "\n";

        // accoding to the problem statement
        // here, we cannot use the -1 input condition to break out of the loop
        // because the input file doesn't contain -1

        // we need to read the file until there is data in the file

        // we can use: infile >> quizScore
        // as the condition in the for loop

        // until there is data in the file, the input file stream object
        // will be valid (or true)

        // when there will be no data left, it will become invalid(or false)
        while (infile >> quizScore) {
                // Note that we have removed the prompt
                // and the file reading is put as the condition in the while loop

                // fill the score into the array
                quizArray[subscript] = quizScore;

                // increment the subscript
                subscript += 1;
        }

        // after all the data has been read, we will close the file
        infile.close();

        // as the subscript variable contains the 
        // index of the next block, its value will be equal
        // to the size of the array
        return subscript;
}


/***************************************************************
Function: void printQuizArray()

Use: Prints the array of scores the student got in quizzes.

Argument: string : a title which says - "Quiz Scores"
                  integer array : containing the scores of the quizzes
                  integer : containing the number of elements in the array

Returns: Nothing.

Note: None.
***************************************************************/
void printQuizArray (string title, int quizArray[], int numberOfQuizzes) {
                
        cout << "\n" << title;
        cout << "\n------------------";

        for (int i = 0; i < numberOfQuizzes; ++i) {
                // as the subscript starts from 0, 
                // while printing, we will add 1 to it
                cout << "\nQuiz " << i + 1 << "\t" << quizArray[i] << "/10";
        }

        cout << "\n\n";
}

/***************************************************************
Function: void copyArray()

Use: Copies the elements of the source array into destination
         array.

Argument: integer array : destination array in which copying has 
                                                  to be done
                  integer array : source array from which copying has 
                                                  to be done
                  integer : containing the number of elements in the array

Returns: Nothing.

Note: None.
***************************************************************/
void copyArray (int destination[], int source[], int numberOfValues) {
                
        // copying the elements of source in destination
        for (int i = 0; i < numberOfValues; ++i) {
                destination[i] = source[i];
        }
}

/***************************************************************
Function: void sortArray()

Use: Sorts the input array given as an argument. 

Argument: integer array : whose elements need to be sorted in 
                                                  ascending order.
                  integer : containing the number of elements in the array

Returns: Nothing.

Note: We have employed Selection Sort to sort the elements.
***************************************************************/
void sortArray (int array[], int numberOfQuizzes) {
                
        // selection sort
        // 1. Pick an element from the start
        // 2. find the position of the minimum element
        // 3. replace the picked element with the minimum element
        // 4. Do this for all the elements 

        // we will run our loop for numberOfQuizzes - 1 elements
        // because, after this, the last element will automatically
        // be on its correct position
        for (int i = 0; i < numberOfQuizzes - 1; ++i) {
                        
                int minIndex = i;

                // find the minimum element in the array right to index i
                for (int j = i + 1; j < numberOfQuizzes; ++j) {
                        if (array[j] < array[minIndex]) {
                                minIndex = j;   
                        }
                }

                // swap the minimum element found and the ith element
                swap (array[i], array[minIndex]);
        }
}

/***************************************************************
Function: double calcQuizAverage()

Use: Calculates the average of the integers given according 
         to certain conditions(specified in problem statement). 

Argument: integer array : whose elements need to be sorted in 
                                                  ascending order.
                  integer : containing the number of elements in the array

Returns: double : denoting the average of integers of the array.

Note: The formula used depends on the number of elements in the
          array: 

          1. If the elements are greater than 2, then use: 
                average = (sumOfScores - sumOfTwoLowestQuizzes) / (10 * (numberOfQuizzes - 2)) * 100

          2. If the elements are smaller than or equal to 2, then use:
            average = sumOfScores / (10 * numberOfQuizzes) * 100

***************************************************************/
double calcQuizAverage (int quizArray[], int numberOfQuizzes) {
                
        // sum up the scores of all the quizzes
        int sumOfScores = 0;

        for (int i = 0; i < numberOfQuizzes; ++i) {
                sumOfScores += quizArray[i];
        }

        double average = 0.00;

        // check the number of quizzes

        // if the numberOfQuizzes are greater than 2
        if (numberOfQuizzes > 2) {
                
                // allocate the memory for copy array
                int * newArray = new int [12];

                // copy the contents to the newArray
                copyArray (newArray, quizArray, numberOfQuizzes);

                // sort the new array
                sortArray (newArray, numberOfQuizzes);

                int sumOfTwoLowestQuizzes = newArray[0] + newArray[1];

                // using the formula as mentioned in the problem statement
                average = (double) (sumOfScores - sumOfTwoLowestQuizzes) / (10 * (numberOfQuizzes - 2));
                average *= 100;
        } else {
                average = (double) sumOfScores / (10 * numberOfQuizzes);
                average *= 100;
        }

        return average;
}

/***************************************************************
Function: int main()

Use: Contains the driver code for testing the program. 

Argument: None.

Returns: integer : as a status code. 

Note: None.
***************************************************************/
int main (void) {
                
        // declaring an array of integers with size 12
        int * quizArray = new int [MAX_SIZE];

        // declaring the integer varible 
        // to hold the number of quizzes completed by student
        int numberOfQuizzes = 0;
        
        // calling the buildQuizArray() to get the input
        // this function returns the number of quizzes completed by student
        numberOfQuizzes = buildQuizArray (quizArray);

        // calling the calcQuizAverage() to get the quiz average
        double quizAverage = calcQuizAverage (quizArray, numberOfQuizzes);

        // we are using fixed and setprecision from #include <iomanip> 
        // for displaying the double variable upto 2 decimal places
        cout << "\nYour quiz average is " << fixed << setprecision(2) << quizAverage << "%\n";
        
        // calling the printQuizArray function to print the 
        // students' quiz score
        printQuizArray ("Quiz Scores", quizArray, numberOfQuizzes);

        return 0;
}


Related Solutions

For this assignment, write a program that will calculate the quiz average for a student in...
For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be written in two versions. The first version of the program will read a set of quiz...
Overview For this assignment, write a program that will calculate the quiz average for a student...
Overview For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be written in two versions. The first version of the program will read a set of...
Overview For this assignment, write a program that will calculate the quiz average for a student...
Overview For this assignment, write a program that will calculate the quiz average for a student in the CSCI course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be written in two versions. The first version of the program will read a set of quiz...
Overview For this assignment, write a program that will calculate the quiz average for a student...
Overview For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be written in two versions. The first version of the program will read a set of...
Overview For this assignment, write a program that will calculate the quiz average for a student...
Overview For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be written in two versions. The first version of the program will read a set of...
OverviewFor this assignment, write a program that will calculate the quiz average for a student in...
OverviewFor this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array.For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores).It is recommended that this program be written in two versions. The first version of the program will read a set of quiz scores from...
Write a program that will calculate numerical and letter grades for a student and output a...
Write a program that will calculate numerical and letter grades for a student and output a report: The information will be in the provided data file studentGrades.txt. The data file consists of several rows of data containing a student name and information for 3 types of assignments: First Name, Last Name, number of homework grades, values for homework grades, percentage of total grade, number of program grades, values for program grades, percental of total grade, number of ex-am grades, values...
Write a program that will calculate numerical and letter grades for a student and output a...
Write a program that will calculate numerical and letter grades for a student and output a report: The information will be in the provided data file studentGrades.txt. The data file consists of several rows of data containing a student name and information for 3 types of assignments: First Name, Last Name, number of homework grades, values for homework grades, percentage of total grade, number of program grades, values for program grades, percental of total grade, number of ex-am grades, values...
Write a program to calculate fees that must be paid by a student at a State...
Write a program to calculate fees that must be paid by a student at a State university using the following values: Each semester unit $90.00 Regular room charge per semester $200.00 Air conditioned room $250.00 Food charge for the semester $400.00 Matriculation fee (all students) $30.00 Diploma fee (if graduating student) $35.00 Input student ID number (one integer containing four digits), the type of room (regular or air conditioned), units, and whether or not the student is graduating. Output an...
Overview For this assignment, write a program that will calculate the amount that a customer spends...
Overview For this assignment, write a program that will calculate the amount that a customer spends on tickets at a movie theater. This program will be continued in program 3 so it is important that this program is completed. Basic Program Logic The basic logic for this program is similar to program 1: the user is asked to enter values, a calculation is performed, and the result of the calculation is displayed. For this program, prompt the user for the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT