How would questions 5 and 6 be answered? C statements Read the following code. F
ID: 3870646 • Letter: H
Question
How would questions 5 and 6 be answered? C statements
Explanation / Answer
5.
Category
Rate
Total
M
21
42
H
12
100
G
20
120
6.
#include<stdio.h>
int main()
{
int rate = 20;
total = 100;
char category ;
scanf("%c",&category);
if(category=='M')
{
rate++;
total = rate * 2;
}
else if(category=='F')
{
total = rate * 2;
}
else if(category=='H'||category=='D')
{
rate=(int)(total/8);
}
else
total+=rate;
}
Category
Rate
Total
M
21
42
H
12
100
G
20
120
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.