You will code, build, and execute two programs requiring arrays and strings.
First program (Video Game Player Program): Determine the average score for a group of players and then determine who scored below average.
Second program (Pig Latin): Convert words in a phrase to pig latin.
Learning outcomes:
1. Be able to explain the need for arrays in a program.
2. Be able to determine the appropriate array data type to use in a given program.
3. Be able to write a program that implements arrays.
4. Be able to explain the way memory is allocated for arrays in a program.
5. Be able to explain the fact that arrays are objects in C++.
6. Be able to write a program that implements strings.
#include <iomanip>
#include <string>
using namespace std;
void headings ();
int main ()
{
string playerName;
string names[]={"Player Name"};
double score [6];
int average[6];// after finding the scores
double ext [6]; // if you can compute then don't store
//input new data
for (int i=0; i<6; ++i)
{
cout << " Enter player name (Q to quit)" << names[i]<<":" ; cin >> playerName[i];
cout << "Enter score for :"; cin >> score[i];
}
headings ();
//show report data
for (int i=0; i<6; ++i)
{