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 is one reason that writing effective messages is so important
jarptica [38.1K]
Effective communication proves the sender is technologically advanced
3 0
2 years ago
Read 2 more answers
Assume that a signal is encoded using 12 bits. Assume that many of the encodings turn out to be either 000000000000, 00000000000
Mashcka [7]

Answer:

The following is the answer to this question:

Explanation:

In the binary digit

000000000000 is equal to 0 bit

000000000001 is equal to 1 bit

1 1 1 1 1 1 1 1 1 1 1 1 is equal to 10

Similarly,

000000000010=11

Thus,

00 \ 00 \ 01 \ 10\  010101010101 is equal to

000000000000, 000000000000, 000000000001 ,

000000000010,  1 1 1 1 1 1 1 1 1 1 1 1 , 000000000001 , 000000000001 , 000000000001 ,  

000000000001 , 000000000001 , 000000000001

8 0
3 years ago
List the types of infrared we have
Vlad [161]

Answer: infared types like the sun, sun light, heat lamps, and radiators

6 0
3 years ago
The World Health Organization decided that addiction to video games is considered a mental health disorder. Do you agree or disa
Blababa [14]

Answer:

I disagree and I will tell you why because there was study based on video games and seniors and the theory was that they play games to keep there minds active. I will give you an example let's say you were in a situation and you learned how to make or create something from playing video games, in closeur video games can help us in problems

8 0
3 years ago
What does setTempo() allow you to do in EarSketch?
vlada-n [284]
Specify the tempo of a song
4 0
2 years ago
Other questions:
  • When desktop publishing software can interact with another software program, the two are said to
    6·1 answer
  • It is either snoming or below freezing
    10·1 answer
  • Suppose that a computer virus infects your computer and corrupts the files you were going to submit for your current homework as
    12·1 answer
  • 8. A pattern of being late for work or for appointments is usually
    12·1 answer
  • It is important to verify internet source because-------- choose that apply. A.the source should be written by real author. B.an
    6·2 answers
  • When a bank account pays compound interest, it pays interest not only on the principal amount that was deposited into the accoun
    10·1 answer
  • How are Earth's plates made?
    14·1 answer
  • Does anyone know how to change your username? plz help I don't want my name on this lmo
    8·2 answers
  • What is the main difference between a peripheral device and other types of devices? Choose the best answer.
    12·1 answer
  • Would it be feasible to combine fixed length field and variable length field format in single disk
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!