1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
TiliK225 [7]
3 years ago
11

Write a program to define three variables to hold three test scores. The program should ask the user to enter three test scores

and then assign the values entered to the variables. The program should display the average of the test scores and the letter grade that is assigned for the test score average. Use the grading scheme in the following table. 90 or greater 80-89 70-79 60-69 Below 60
Computers and Technology
1 answer:
Elza [17]3 years ago
7 0

Answer:  

It's always good to use if else with boolean expressions in such cases.

Explanation:

I have written a program  where I have used c# as programming language.

I used if else block with boolean expressions to enforce conditions to print the grades according to the average of test scores. I have used Logical And(&&) operator in boolean expressions so that all the conditions in if and if else  must be true

Here is the program:  

using System;

public class Test

{

   public static void Main()

   {

       int testScore1, testScore2, testScore3;

       Console.WriteLine("enter first testScore");

       testScore1 = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine("enter second testScore");

       testScore2 = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine("enter third testScore");

       testScore3 = Convert.ToInt32(Console.ReadLine());

       float avg = (testScore1 + testScore2 + testScore3) / 3;

       if(avg>=90)

       {

           Console.WriteLine("You got grade A");

       }

       else if(avg >=80 && avg <=89)

       {

           Console.WriteLine("You got grade B");

       }

       else if (avg >= 70 && avg <= 79)

       {

           Console.WriteLine("You got grade c");

       }

       else if (avg >= 60 && avg <= 69)

       {

           Console.WriteLine("You got grade D");

       }

       else if(avg< 60)

       {

           Console.WriteLine("You got grade E");

       }

       else

       {

           Console.WriteLine("Sorry, You failed");

       }

       Console.ReadLine();

   }    

}

Explanation of program:  

I created three variables named, testScore1, testScore2, testScore3 of datatype int. I prompted the user to enter three test score values. Each value is read using Console.ReadLine() . As the value entered is of type integer, I converted the  console read value into int using Convert method.  

In the next step, I calculated average using the formula.  

Now, Based on the average, I can calculate the grade according to the given grading scheme.

You might be interested in
What are some of the advantages of using the F measure (weighted harmonic mean) over using the Precision &amp; Recall when evalu
Art [367]

Answer and Explanation:

Some of the advantages of using the F measure (weighted harmonic mean) over using the Precision & Recall when evaluating an IR system performance are as follows-

  • Precision quantifies the number of positive class predictions that actually belong to the positive class.
  • Recall quantifies the number of positive class predictions made out of all positive examples in the dataset.
  • F-Measure provides a single score that balances both the concerns of precision and recall in one number.
  • A measure that combines precision and recall is the harmonic mean of precision and recall, the traditional F-measure or balanced F-score:

F=2((precision.recall)/(precision+recall))

6 0
3 years ago
Rounding up and down for 389,422
elena-14-01-66 [18.8K]

Answer:

389420

389430

Explanation:

the up is for 389430

the down is for 389420

4 0
3 years ago
Your friend sends you a computer game. after installing the game on your computer, you realize that it plays very slowly. you kn
dsp73
Memory possibly. Or another pricessor.
8 0
3 years ago
Guys im getting the ps5 tomorrow :)​
Paha777 [63]

Answer:

lucky mf

Explanation:

5 0
2 years ago
Read 2 more answers
You are a very small company that sells healthcare insurance plans. You estimate that the breach of your customer database will
lozanna [386]

Answer:

C. Accept the risk

Explanation:

The first option is close but might not be suitable for a small company considering it's cost.

The second option which is to spend fifty thousand dollars per year on a data loss prevention solution is projected to cost you more than the risk.

The third option isn't specific and lacks a course of action.

6 0
3 years ago
Other questions:
  • LOOK TO THE LEFT AND RIGHT BEFORE ENTERING ANY INTERSECTION ON A GREEN LIGHT BECAUSE:
    12·2 answers
  • Select the correct answer.
    15·1 answer
  • Which of the following statements is NOT true about a mainframe computer?
    14·1 answer
  • After clicking the Start button on your computer screen desktop, what option would you then select to examine system components
    5·1 answer
  • Where could an identity theft access your personal information?
    9·2 answers
  • Write a class called Person that has two data members - the person's name and age. It should have an init method that takes two
    12·1 answer
  • Which statements about editing an existing Contact in Outlook are true? Check all that apply.
    9·2 answers
  • How do people decide their ethical behavior
    13·2 answers
  • WILL GIVE BRAINLIEST!!! PLEASE HELP!!!
    5·1 answer
  • TO Cloud
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!