QUESTION IMAGE
Question
follow these instructions to complete your assignment: 1. write a flowchart and c code for a program that does the following: • declare variables with integer or float datatypes. • assign the values of three grades (84, 98, 73) to each of the variables • compute the average of the grades - keep the order of operations in mind • display the average using an appropriate message • add a decision that checks to see if the average grade is greater than 65, if true display a message that the student passed. • be sure to add comments throughout your program describing what is happening 2. review the output below to check your work. 3. paste the following three items into a word document (.docx): a. your flowchart in flowgorithm b. a screenshot of your code c. a screenshot of your output (including the title bar showing)
Step1: Write flowchart
- Start with a start - stop symbol.
- Use input symbols to declare integer or float variables for grades.
- Use assignment symbols to assign values 84, 98, 73 to variables.
- Use a processing symbol to calculate the average (sum of grades divided by 3).
- Use an output symbol to display the average.
- Use a decision symbol to check if average > 65.
- If true, use an output symbol to display "Student passed".
- End with a start - stop symbol.
Step2: Write C code
#include <stdio.h>
int main() {
// Declare integer variables for grades
int grade1 = 84, grade2 = 98, grade3 = 73;
float average;
// Calculate the average
average = (float)(grade1 + grade2 + grade3) / 3;
// Display the average
printf("The average grade is: %.2f
", average);
// Check if the student passed
if (average > 65) {
printf("The student passed.
");
}
return 0;
}Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
Flowchart as described in Step1 and C code as above.