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
The field that uses technology to manipulate and use information to improve healthcare is known as:_______
Sergeu [11.5K]

Answer:

Health informatics

Explanation:

7 0
1 year ago
In a flashdisk wich icon can you use to open files in computer​
Dvinal [7]

Answer:

In a flashdisk,

If you are windows: click "my computer", and under the "cpmputer" section, you will find your flashdisk's name, and click it, in there you can find and also open your files.

If you are Mac: click "Finder", click "Desktop" and find your flashdisk's name, and click it, in there you can find and also open your files.

6 0
3 years ago
I need someone whos really good with computers to help me with some things
posledela

Okay what do you need to know

4 0
3 years ago
You’ve been tossed into an insane asylum. What do you tell the people there to prove to them that you don’t belong inside?
mars1129 [50]
Was this a question on an assignment or are you in an asylum right now
3 0
3 years ago
Read 2 more answers
For what reason can security risks never be fully eliminated?​
raketka [301]

Answer:

A vulnerability level of ZERO can never be obtained since all countermeasures have vulnerabilities themselves. For this reason, vulnerability can never be zero, and thus risk can never be totally eliminated.

Explanation:

also we need to be protected from scams and stuff

7 0
3 years ago
Other questions:
  • The numbers on the bottom of a typical check represent all of the following EXCEPT?
    12·2 answers
  • The purpose of the ________ element is used to configure the main content of a web page document.
    5·1 answer
  • It is essential that a security professional is able to resolve and respond to cyber law inquiries and incidents while avoiding
    14·1 answer
  • A user can easily move to the end of a document by pressing the _____ key combination.
    10·2 answers
  • How would you display all your photographic work in your résumé, if you have a large volume of work?
    10·1 answer
  • Examine the following algorithm.
    9·1 answer
  • According to the stage-gate process developed by Robert G. Cooper, _____ are the results of the previous stage and are the input
    15·1 answer
  • The cat store needs your help! The base class Animal has private fields animalName, and animalAge. The derived class Cat extends
    9·1 answer
  • In the past, workers would usually complete ______. a. A variety of tasks on a daily basis b. The same tasks every day c. Thinki
    9·2 answers
  • A _______ is a group of elements that you want to style in a particular way.
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!