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

This program will determine the letter grade for a student. It will ask for scores (could...
This program will determine the letter grade for a student. It will ask for scores (could be labs, activities, quizzes, or projects) and then display some basic statistics derived from the scores. In Python, Write a program that continuously asks for a non-negative score until the user enters -1. IF the user enters a valid score ask for the possible score for that assignment, we will not assume all scores will have the same maximum value. We will assume that...
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...
Write a program that prompts the user for a grade (0-100), and asks if the student...
Write a program that prompts the user for a grade (0-100), and asks if the student is a graduate student or not. (Y/N).   If the student is a graduate student, the grade is reduced by 10%, because we have a higher expectation for graduate students, in an undergraduate class. The program then computes, and prints the letter grade based on the scale below. 90-100 A 80-89 B 70-79 C 60-69 D 0-60 F The program also provides feedback based on...
Write a C++ program named, myGrade.cpp, that calculates a letter grade for a student of this...
Write a C++ program named, myGrade.cpp, that calculates a letter grade for a student of this course (CSC100 online) based on three user inputs. This program should begin by printing the title of the application (program) and a brief description of what it does. (Note: this is NOT the same as the program prolog: a prolog is much more detailed, has required elements, and is intended for other programmers reading the cpp file. The title and description displayed by the...
Write a C program that prints the Grade of each student in a class based on...
Write a C program that prints the Grade of each student in a class based on their mark. The program must also print the average mark of the class. The program must prompt (ask) the user for the mark of a student (out of 100). The program must then print the mark entered and the grade received based on the table below. Grade Range A 85 to 100 inclusive B 75 to 85 inclusive C 60 to 70 inclusive D...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT