Question #109805

As a student programmer, you have been tasked to create a program

that will be used by a smaller college to manage test results. The

school has closed because of COVID19 but has continued lessons

online.

As part of the program development life cycle, illustrate and explain

the activities that you are going to do in this project during;

1. Analysis

2. Design

3. Development

4. Testing

5. Implementation

Expert's answer

#include <iostream>


using namespace std;


void checkAnswers(string my, string right);


int main()
{
    string right_answers = "abcacabbb";
    string my_answers;
    cout << "Please, enter all the " << right_answers.size() << " answers in one string!" << endl;
    cin >> my_answers;
    checkAnswers(my_answers, right_answers);
    return 0;
}


void checkAnswers(string my, string right)
{
    int i, counter = 0;
    int num = right.size();
    for(i = 0; i < num; i++)
    {
        if(my[i] != right[i])
            counter++;
    }
    if(counter == 0)
        cout << "All is right! Good job!";
    else
        cout << "You have made " << counter << " mistakes. Please, try again!";
}

LATEST TUTORIALS
APPROVED BY CLIENTS