Question

C++: CBEST was developed to meet requirements of laws relating to credentialing and employment. The CBEST...

C++: CBEST was developed to meet requirements of laws relating to credentialing and employment. The CBEST has three sections: Math, Reading, and Writing. The passing score on each CBEST section is a score of 41. A total score of 123 is required for passing status. It is possible to pass the CBEST with a score on one or two sections as low as 37, provided the score is 123 or higher. It is not possible, however, to pass the CBEST if any section is below 37, regardless of how high the total score may be. Write a program that prompts a test grader to input the scores for each section. The program should then output the total score, the passing status for each section, and the pasing status for the test as a whole. Each line of the input file consists of test scores for each section, Math, Reading, and Writing. respectively. Each line of the output file consists of the Total Score, Status for Math section, Status for readin section, status for writing section, and status for the entire test.

Input: ----------------------------- output:

50 60 41 151 ----------------- Passed Passed Passed Passed

41 41 41 123 ------------------ Passed Passed Passed Passed

50 50 37 137 -------------------Passed Passed Failed Passed

36 47 89 172 -------------------Failed Passed Passed Failed

40 40 40 120-------------------- Failed Failed Failed Failed

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>
using namespace std;

struct info
{
    unsigned int math;
    unsigned int reading;
    unsigned int writing;
};

int main()
{
    int i;
    struct info data[5];

    cout<<"Enter input data"<<endl;

    for(i=0; i<5; i++)
    {
        cin>>data[i].math;
        cin>>data[i].reading;
        cin>>data[i].writing;
    }

    cout<<"OUTPUT"<<endl;

    for(i=0; i<5; i++)
    {
        cout<<data[i].math<<" "<<data[i].reading<<" "<<data[i].writing<<" "<<(data[i].math+data[i].reading+data[i].writing)<<"   .... ";
        if(data[i].math >= 41){
            cout<<"Passed ";
        }else{
            cout<<"Failed ";
        }

        if(data[i].reading >= 41){
            cout<<"Passed ";
        }else{
            cout<<"Failed ";
        }

        if(data[i].writing >= 41){
            cout<<"Passed ";
        }else{
            cout<<"Failed ";
        }

        if( (data[i].math+data[i].reading+data[i].writing) >= 123)
        {
            cout<<"Passed"<<endl;
        }else{
            cout<<"Failed"<<endl;
        }
  
    }

    return 0;
}

Add a comment
Know the answer?
Add Answer to:
C++: CBEST was developed to meet requirements of laws relating to credentialing and employment. The CBEST...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT