Question

In: Computer Science

write a program that will display student grade if scores is greater than or equal to...

write a program that will display student grade if scores is greater than or equal to 70 to display A or else if score is less than or equal to 70 and greater than or equal to 60 display B if scores is less than 60 or greater than 50 display C else display fail.

Solutions

Expert Solution

C program)

#include <stdio.h>

int main(void) {
  int score;
  printf("Enter score: ");//user input for score
  scanf("%d",&score);
  if(score>=70)
      printf("Grade is : A");
    //if score in between 60 to 70 print B
    else if(score>=60 && score<70)
      printf("Grade is : B");
    //if score in between 50 to 60 print B
    else if(score>50 && score<60)
        printf("Grade is : C");
    //else print fail
    else
        printf("Fail");
  return 0;
}

Output::

If you want program in JAVA refer below code:

import java.util.Scanner;//import Scanner
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);//creates object of class Scanner
    System.out.print("Enter score:");//user input for score
    int score = sc.nextInt();
    //if score >= 70 print A
    if(score>=70)
       System.out.print("Grade is : A");
    //if score in between 60 to 70 print B
    else if(score>=60 && score<70)
      System.out.print("Grade is : B");
    //if score in between 50 to 60 print B
    else if(score>50 && score<60)
        System.out.print("Grade is : C");
    //else print fail
    else
        System.out.print("Fail");
   
  }
}

Output::

Note:: if any queries please comment else thumbs up!


Related Solutions

1. ​ a)​Write a Matlab program to define student grade program and student number with if-else...
1. ​ a)​Write a Matlab program to define student grade program and student number with if-else statement logic​​​​​​​​​ b)​Write a Matlab program for sensor selection of temperature, pressure, flow sensor with if-else statement logic​​​​​​​​​ ​ 2.​Assume there are four letters from an information source with probabilities as A1 0.5 A2 0.3 A3 0.1 A4 0.1 Generate the tag and find the corresponding gaps and binary values for each stage and the sequence of the symbols which are coded are a1a3a2a4a1.​​​...
Lab 3.4 Write a program that determines a student’s grade. The student will enter a grade...
Lab 3.4 Write a program that determines a student’s grade. The student will enter a grade and the program will determine if that grade is an A, B, C, D, or E. The student can only enter number 0-100. A = 90-100 B = 80-89 C = 70-79 D= 60-69 E = 59 or less Save the file as Lab3.4 and submit the file. Use https://repl.it/ THIS LANGUAGE IS PYTHON Thank you :)
Write a program that determines a student’s grade. The program will read three types of scores...
Write a program that determines a student’s grade. The program will read three types of scores (quiz, mid-term, and final scores) and determine the grade based on the following rules: -if the average score =90% =>grade=A -if the average score >= 70% and <90% => grade=B -if the average score>=50% and <70% =>grade=C -if the average score<50% =>grade=F Using Switch Statement Need to code to be simple to understand. No pointers should be used
Write a program that asks the user to enter five test scores. The program should display...
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following methods in the program: calcAverage: This method should accept five test scores as arguments and return the average of the scores. determineGrade: This method should accept a test score as an argument and return a letter grade for the score, based on the following grading scale: Score Letter Grade 90-100...
Get all homework scores for one student, calculate and display the sum of the scores, and...
Get all homework scores for one student, calculate and display the sum of the scores, and also display the word “fail” if the sum is lower than 150. Note: we do not know how many homework scores each student will enter. Ask the user how many homework scores there are at the beginning. Then, ask for a homework score at a time, for as many times as indicated by the user. C++
Write a program to take input of scores for Chemistry, Biology and English for a student...
Write a program to take input of scores for Chemistry, Biology and English for a student and display the average with 2 decimal places if all of the three scores are in the range between 1 and 100 inclusive. Program should also display the course name for which scores are entered out of range telling Average couldn't be calculated. Following is a sample run: Enter scores for Chemistry, Biology and English between 1 and 100: 45 89 96 Avg score...
Write a C program that calculates a student grade in the C Programming Class. Ask the...
Write a C program that calculates a student grade in the C Programming Class. Ask the user to enter the grades for each one of the assignments completed in class: Quiz #1 - 25 points Quiz #2 - 50 points Quiz #3 - 30 points Project #1 - 100 points Project #2 - 100 points Final Test - 100 points The total of the quizzes count for a 30% of the total grade, the total of the projects counts for...
For each of the following, fill in the blanks with "Less than", "Greater than", or "Equal...
For each of the following, fill in the blanks with "Less than", "Greater than", or "Equal to" *) A gas flows through a one-inlet, one-exit control volume operating at steady state with no internal irreversibilities, Qcv = 0. Heat transfer at a rate Qcv takes place only at a location on the boundary where the temperature is Tb. The specific entropy of the gas at the exit is _____ than the specific entropy of the gas at the inlet. *)...
Prove that if n is greater than or equal to 4 then the center of the...
Prove that if n is greater than or equal to 4 then the center of the alternating subgroup An is the trivial subgroup. What is Z(An) for n = 0,1,2,3 ?
Sections 7.1 Write a program that reads student scores, gets the best score, and the assigns...
Sections 7.1 Write a program that reads student scores, gets the best score, and the assigns grades based on the following scheme: Grade is A if scores is >= best - 10; Grade is B if scores is >= best - 20; Grade is C if scores is >= best - 30; Grade is D if scores is >= best - 40; Grade is F otherwise. The program prompts the user to enter the total number of students, then prompts...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT