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]
4 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]4 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 the function of an ISP,a browser and a mobile browser?​
ruslelena [56]

An internet service provider (ISP) is a company that provides web access to both businesses and consumers. ISPs may also provide other services such as email services, domain registration, web hosting, and browser services.

The purpose of a web browser is to fetch information resources from the Web and display them on a user's device. This process begins when the user inputs a Uniform Resource Locator (URL), such as wikipedia.org, into the browser.

A mobile browser is a web browser designed for use on a mobile device such as a mobile phone or PDA. Mobile browsers are optimized to display Web content most effectively for small screens on portable devices.

8 0
3 years ago
In what decade did the Internet begin to be used widely by the public and not just government entities?
Allisa [31]
In the 1980's the internet was open to the public
But it wasn't until the 2000's that it started to be widely used
Your answer is C 2000's
3 0
3 years ago
Read 2 more answers
When adding a new record, which key can be pressed to move to the next field?
Anika [276]

Answer:

O Tab

Explanation:

In order to add a new record the key that should be used to move to the next field is tab key

while the other keys are used for the other purpose

But for adding a new field, new record, a tab key should be used

Therefore the last option is correct

8 0
3 years ago
The break statement is used with which statement?<br> A)at<br> B)for<br> C)nested if<br> D)switch
Klio2033 [76]

Answer:

B) for

Explanation:

The break statement is used in looping constructs to break out of the loop.

for is an example of a construct used for looping n Java.

Consider the example:

for(int i=0;i<10;o++){

      System.out.print(i);

      if(i==5)break;

}

In this case the output will consist of 012345 .

When loop variable i is equal to 5, the if condition will be satisfied and the loop breaks due to break statement.

Note that break is also used with switch...case blocks, but in this case it is more closely tied to the case statement.

5 0
3 years ago
Taking an online class doesn't require any special skills. T or F ? ​
Sidana [21]

Answer:

false

Explanation:

more demanding than regular school

7 0
4 years ago
Other questions:
  • Have you ever tried to teach a class full of restless, active sixth-graders? I have. I taught sixth-grade students for 12 years.
    15·1 answer
  • Which osi layer is responsible for combining bits into bytes and bytes into frames?
    8·1 answer
  • What does it mean for a school to be “accredited”?
    5·1 answer
  • Employees of ABC company uploaded files on a shared server with unique file naming conventions. However, they faced problems whi
    15·2 answers
  • Is something wrong with Brainly?
    5·2 answers
  • Go to your Canvas course and locate the Assignment: Writing Prompt 1: Is the Internet making us Meaner?and complete the activity
    13·2 answers
  • The LCM of 4, 9, and 10 is _______.
    7·2 answers
  • 3s X 82 = X +y? is this true
    10·2 answers
  • Before the 20th century how did most people experience computing​
    9·1 answer
  • To meet the requirement for the number of vdss on board, what must be true about pyrotechnic vdss?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!