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
agasfer [191]
3 years ago
15

A numeric test score is to be converted to a letter grade of A, B, or C according to the following rules: A score greater than 9

0 is considered an A; a score between 80 and 90, inclusive, is considered a B; and any other score is considered a C. What code segments will assign the correct letter grade to grade based on the value of the variable score?
Computers and Technology
1 answer:
arlik [135]3 years ago
7 0

The code segment makes use of conditional statements.

Conditional statements in programming are used to make decisions

The code segment in C++ is as follows

if (score > 90) {

grade = 'A';

}

else if (score >= 80 && score < =90) {

grade = 'B';

}

else {

grade = 'C';

}

The above code segments take the score, make comparison, and then determine the appropriate letter grade.

Read more about code segments at:

brainly.com/question/20475581

You might be interested in
Edhesive coding practice 3.4​
malfutka [58]

Answer:

green= input("Enter the Green")

if(green == "green"):

   print("You have entered correct option")

else:

   print("You have entered wrong option")

Explanation:

We need to explain the if else ladder through the Python program. And the program for it can be found in the answer section.

7 0
3 years ago
Assume the existence of an UNSORTED ARRAY of n characters. You are to trace the CS111Sort algorithm (as described here) to reord
makvit [3.9K]

Answer:

class Main {

  public static void main(String[] args) {

      char arr[] = {'T','E','D','R','W','B','S','V','A'};

      int n = arr.length;

      System.out.println("Selection Sort:");

      System.out.println("Iteration\tArray\tComparisons");

      long comp1 = selectionSort(arr);

      System.out.println("Total comparisons: "+comp1);

      System.out.println("\nInsertion Sort:");

      System.out.println("Iteration\tArray\tComparisons");

      long comp2 = insertionSort(arr);

      System.out.println("Total Comparisons: "+comp2);

      System.out.println("\nOverall Total Comparisons: "+(comp1+comp2));

  }

  static long selectionSort(char arr[]) {

      // applies selection sort for n/2 elements

      // returns number of comparisons

      int n = arr.length;

      long comparisons = 0;

 

      // One by one move boundary of unsorted subarray

      for (int i = n-1; i>=n-n/2; i--) {

              // Find the minimum element in unsorted array

              int max_idx = i;

              for (int j = i-1; j>=0; j--) {

                      // there is a comparison everytime this loop returns

                      comparisons++;

                      if (arr[j] > arr[max_idx])

                              max_idx = j;

              }

              // Swap the found minimum element with the first

              // element

              char temp = arr[max_idx];

              arr[max_idx] = arr[i];

              arr[i] = temp;

              System.out.print(n-1-i+"\t");

              printArray(arr);

              System.out.println("\t"+comparisons);

      }

     

      return comparisons;

  }

  static long insertionSort(char arr[]) {

      // applies insertion sort for n/2 elements

      // returns number of comparisons

      int n = arr.length;

      n = n-n/2;   // sort only the first n/2 elements

      long comparisons = 0;

      for (int i = 1; i < n; ++i) {

          char key = arr[i];

          int j = i - 1;

          /* Move elements of arr[0..i-1], that are

                  greater than key, to one position ahead

                  of their current position */

          while (j >= 0) {

              // there is a comparison everytime this loop runs

              comparisons++;

              if (arr[j] > key) {

                  arr[j + 1] = arr[j];

              } else {

                  break;

              }

              j--;

          }

          arr[j + 1] = key;

          System.out.print(i-1+"\t");

          printArray(arr);

          System.out.println("\t"+comparisons);

      }

      return comparisons;

  }  

  static void printArray(char arr[]) {

      for (int i=0; i<arr.length; i++)

          System.out.print(arr[i]+" ");

  }

}

Explanation:

Explanation is in the answer.

6 0
3 years ago
Microsoft words spell checker
Virty [35]
To check spelling<span> in a </span>Word<span> document, open up the document, head to the “Review” tab, then click on “</span>Spelling<span> & Grammar” (part of the “Proofing” group of tools). 

</span>
4 0
3 years ago
Why do some people think the global<br> economy is good for the United States?
maksim [4K]

Answer: is a

Explanation:

3 0
3 years ago
What is the purpose of application software policies?
timofeeve [1]

Answer:

d. They serve to help educate users on how to use software more securely.

Explanation:

A software policy can be defined as a set of formally written statements that defines how a software application or program is to be used.

The purpose of application software policies is that they serve to help educate users on how to use software more securely. It must be easy to read, learn and understand by the end users.

7 0
3 years ago
Other questions:
  • What does BMP stand for?
    10·2 answers
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • Type the correct answer in the box. In which phishing technique are URLs of the spoofed organization misspelled? _____ is a phis
    11·1 answer
  • Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.
    8·1 answer
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • Big Project, Giving 5 stars, a Thanks, 80 points, and Branliest to whoever answers them correctly
    9·2 answers
  • Which sentence is correctly punctuated? WILL GIVE YU MONEY GIVE ME YOUR CASH APP PLS
    12·2 answers
  • Which is the OS that can be obtained for free or at a much lower price than other major operating systems?
    15·2 answers
  • Consider the following code segment
    15·1 answer
  • What happens when you apply a theme to a form?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!