Marketplace

Related Articles

More

Related Categories

Recently Added

More

Join StudyUp.com Today

It's always free and anyone can join!

Watch StudyUp Demo Video Now

You Recently Visited

First Grade Writing Prompt

Leslie Said:

Write an algorithm that will prompt an operator for the students first name and exam score out of 100.?

We Answered:

char firstName[16];
int examScore;

printf("Enter first name: ");
fgets(firstName, 16, ifstream);

printf("Enter exam score: ");
scanf("%d", examScore);

if (examScore >= 90)
{
printf ("%cn", 'A');
}
else if (examScore < 90) && (examScore >= 80)
{
printf("%cn", 'B');
}
else if (examScore < 80) && (examScore >= 70)
{
printf("%cn", 'C');
}
else if (examScore < 70) && (examScore >= 60)
{
printf("%cn", 'D');
}
else if (examScore < 60)
{
printf("%cn", 'F');
}

Discuss It!