Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ show pseudocode if you can please The history teacher at your school needs h

ID: 3694043 • Letter: C

Question

C++ show pseudocode if you can please

The history teacher at your school needs help in grading a True/False test. The students rsquo IDs and test answers are stored in a file. The first entry in the file contains answer to the test in the form: TFFTFFTTTTFFTFTFTFTT Every other entry in the file is the student ID, followed by a blank, followed by the student rsquo s responses. For example, the entry: ABC54301 TFTFTFTT TFTFTFFTTFT indicates that the student ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and so on. This student did not answer question 9. The exam has 20 questions, and class has more than 150 students. Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero points. Write a program that processes the test data. The output should be the student rsquo s ID, followed by the answer, followed by the test score, followed by the test grade. Assume the following grade scale: 90% - 100%, A; 80% - 89.99%, B; 70% -79.99%, C; 60% - 69.99%, D; and 0% -59.99%, F.

Explanation / Answer

#include<iostream>
#include <string>
#include <fstream>
using namespace std;

int main()
{
char ans[20];
ifstream file("Answers.txt");
string str1,str;
getline(file,str1);
for(int i=0;i<str1.length();i++)
{
ans[i] = str1.at(i);
}
int score = 0;
while (getline(file, str))
{
//cout<<str1<<endl;
score = 0;
int i;
for(i=0;i<str.length();i++)
{
cout<<str.at(i);
if(str.at(i)==' ')break;
}
int j,k;
for(j=i+1,k=0;k<20;k++,j++)
{
cout<<str.at(j);
if(str.at(j)==' ')continue;
if(str.at(j)==ans[k])score+=2;
else score-=1;
}
cout<<' ';
cout<<score<<' ';
double percent = (score*100.0)/40;
if(percent>=90)cout<<'A'<<endl;
else if(percent>=80)cout<<'B'<<endl;
else if(percent>=70)cout<<'C'<<endl;
else if(percent>=60)cout<<'D'<<endl;
else cout<<'F'<<endl;
}
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote