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
HELP ME ASAP PLS BEING TIMED
kkurt [141]

Answer:

It would be considered cheating.

Explanation:

Any type of electronic use is considered cheating because you can look up the answers on the same phone or text someone for the answer. And so, Text messaging during a test is cheating because of the fact that is convenient to the cheater and not convenient to the teacher that is grading.

8 0
3 years ago
Read 2 more answers
When working in Excel Online, what is it called when you drag the fill handle down to copy data?
SVEN [57.7K]
It’s called drag fill
5 0
3 years ago
Read 2 more answers
Gloria is in her sophomore year of college and works part time. She has assignments saved on her home computer, her aunt's lapto
Tanzania [10]
I think this answer, "<span>Upload all existing documents to a cloud-based program," is correct. Hope I helped!!</span>
4 0
3 years ago
Read 2 more answers
What would the following program print to the screen when run?
Lady bird [3.3K]

Answer:

The output will be:

B

o

n

d

0

0

7

Explanation:

Given code is of Python language

Let us look at the code line by line

The first line is:

my_list = [7, 0, 0, "d", "n", "o", "B"]

This line will create a list with the given elements.

my_list.reverse()

This line will reverse the sequence of the elements of the list

for thing in my_list:

print (thing)

These lines will simply print the reversed elements of the list on screen.

The output will be:

B

o

n

d

0

0

7

8 0
2 years ago
Which of the following statements is TRUE? C++ functions can return a value of type array if it is returned as a base address va
lesantik [10]

Answer:

The answer to this question is "C++ functions can't return array type value".

Explanation:

In C++ language the method is a collection of declarations executing a process together. It is a statement, that tells the compiler to return and accept parameters of a function. In C++, it includes many standardized functions, which can be called by the software, and other choices were wrong, which can be described as follows:

  • In c++ function can't return array type always.  
  • function is not address based.  
  • If array is local to function, but function will not return array value.
3 0
3 years ago
Other questions:
  • Create a class ProblemSolution with following characteristics Two private member variables name &amp; designation of string type
    8·1 answer
  • The method of loci, peg-word system, substitute word system, and method of word association are all examples of _____.
    8·1 answer
  • Which certification can help enhance your job prospects in the role of a computer programmer?
    6·2 answers
  • Write a program using nested loop to produce the following output:
    6·1 answer
  • Which of the following statements about personality are true? Check all of the boxes that apply.
    7·1 answer
  • How do i move a file in python3
    10·1 answer
  • There are two main advantages to using multiple threads in a process: 1) Less work involved in creating a new thread rather than
    7·1 answer
  • Richard needs to copy information from another slide presentation that uses a different design template. To ensure that the info
    10·1 answer
  • Explain the integer and float datatypes with example.<br><br>​
    11·1 answer
  • The diagram shows the positions of the Sun, Earth, and Moon during each moon phase. When viewed from Earth, at what point does t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!