Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

follow these instructions to complete your assignment: 1. write a flowc…

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)

Explanation:

Step1: Write flowchart

  1. Start with a start - stop symbol.
  2. Use input symbols to declare integer or float variables for grades.
  3. Use assignment symbols to assign values 84, 98, 73 to variables.
  4. Use a processing symbol to calculate the average (sum of grades divided by 3).
  5. Use an output symbol to display the average.
  6. Use a decision symbol to check if average > 65.
  7. If true, use an output symbol to display "Student passed".
  8. 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;
}

Answer:

Flowchart as described in Step1 and C code as above.