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
Nat2105 [25]
3 years ago
6

What is wrong with the following code? publicstatic char grade(int score) { if (score >= 9) { return 'A'; } else if (score &g

t;= 8) { return 'B'; } else if (score >= 6) { return 'C'; } else if (score > 4) { return 'D'; } else if (score < 4) { return 'F'; } }
Computers and Technology
1 answer:
UkoKoshka [18]3 years ago
6 0

Answer:

c) No return statement for all possible logic paths

You might be interested in
Is there any app that understands fake photos<br><br><br>help me i need to know it​
Lapatulllka [165]

Answer:

Tineye Image Recognition. This app allows users to upload a picture or a URL to trace where else it appears online. ...

Reversee. This app stays true to its name. ...

Camfind. ...

Reverse Image Search.

7 0
3 years ago
Read 2 more answers
1) How can you set data types such as Number, currency and date in Ms- Excel? 2) Explain how values, text, data and time can be
cestrela7 [59]

Today I am going to share with you my ideas about my favourite time of the day. All time is great. It is God's gift to us to make or mar ourselves. I respect time whether in the morning, afternoon, evening, or night; I just love time.

8 0
3 years ago
Después de un incidente de seguridad del cliente, el equipo realiza un análisis en profundidad de cada paso dado por los atacant
klio [65]

Explanation:

Respuesta al incidente

5 0
3 years ago
What does gigabyte mean
son4ous [18]
A unit of information equal to one billion {109} or, strictly 230 bytes
4 0
4 years ago
Write a client program ClientSorting2 and in the main() method: 1. Write a modified version of the selection sort algorithm (Sel
TEA [102]

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

 public static void SelectionSorter(String[] my_array){

     System.out.print("\nAfter sort: ");

     for (int ind=0; ind < 22; ind++ ){

         int min = ind;

         for (int k=ind+1; k < 23; k++ )

         if (my_array[k].compareTo(my_array[min] ) < 0 ){ min = k;  }

         String temp = my_array[ind];

         my_array[ind] = my_array[min];

         my_array[min] = temp;    }

   for (int j=0; j < 23; j++){   System.out.print(my_array[j]+" ");}

    }

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String [] myarray = new String [23];

 for(int i= 0;i<23;i++){ myarray[i] = input.nextLine();  }

 System.out.print("Before sort: ");

 for ( int j=0; j < 23; j++ ){        System.out.print(myarray[j]+" ");    }

 SelectionSorter(myarray);

}

}

Explanation:

This defines the function

 public static void SelectionSorter(String[] my_array){

This prints the header for After sort

     System.out.print("\nAfter sort: ");

This iterates through the array

     for (int ind=0; ind < 22; ind++ ){

This initializes the minimum index to the current index

         int min = ind;

This iterates from current index to the last index of the array

         for (int k=ind+1; k < 23; k++ )

This compares the current array element with another

         if (my_array[k].compareTo(my_array[min] ) < 0 ){ min = k;  }

If the next array element is smaller than the current, the elements are swapped

<em>          String temp = my_array[ind];</em>

<em>          my_array[ind] = my_array[min];</em>

<em>          my_array[min] = temp;    }</em>

This iterates through the sorted array and print each array element

   for (int j=0; j < 23; j++){   System.out.print(my_array[j]+" ");}

    }

The main begins here

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

This declares the array

 String [] myarray = new String [23];

This gets input for the array elements

 for(int i= 0;i<23;i++){ myarray[i] = input.nextLine();  }

This prints the header Before sort

 System.out.print("Before sort: ");

This iterates through the array elements and print them unsorted

 for ( int j=0; j < 23; j++ ){        System.out.print(myarray[j]+" ");    }

This calls the function to sort the array

 SelectionSorter(myarray);

}

}

3 0
3 years ago
Other questions:
  • Given the plaintext {0F0E0D0C0B0A09080706050403020100} and the key {02020202020202020202020202020202}: a. Show the original cont
    11·1 answer
  • Given non-negative integers x and n, x taken to the nth power can be defined as: x to the 0th power is 1 x to the nth power can
    7·1 answer
  • Jen wants to protect the schools network from hackers,worms,and viruses.she also wants to regulate access to certain websites th
    15·2 answers
  • A model release can be either oral or written down. true or false
    11·2 answers
  • You use worksheets to perform calculations. How do you perform these calculations? ______ are used for performing calculations i
    12·2 answers
  • What effect does the interconnectedness of modern media have on society?
    14·2 answers
  • When power is completely removed from your computer
    11·1 answer
  • What are some other ways to program a robot to navigate a complicated environment other than straight paths and right angle (90
    8·2 answers
  • When spraying pesticide wear and protective eyeglass​
    13·2 answers
  • Parameters and return make
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!