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
OleMash [197]
3 years ago
8

Brian has created the following selection sort class in Java. In which line is the index of the smallest value returned? In whic

h line is the input array given as an argument?
public class SelectionSort{
private static int positionMin (int] vals, int startPosition) {
int minPosition startPosition;
for (int i startPosition; i
if (vals[i] vals[min Position]) {

minPosition = i;
return min

Position; private static void swap(int] vals, int firstPosition, int secondPosition) {

int temp; temp vals[firstPosition];
vals[firstPosition] vals[second Position];
vals[secondPosition] temp return public static void selSort(int| vals) {
int minPos for (int startPos 0; startPos< vals.length; startPos++){

minPos positionMin(vals,startPos); swap(vals,startPos, min Pos) ;

for (int i 0; i< vals.length; i++) { if(i
}else Jelse { System.out.println(vals[i]); } }; }

return; } }
Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
8 0

Answer:

Explanation:

Since there are no line numbers in this question I will start counting from public class SelectionSort{ as line 1 and so on, as well as provide the code on that line.

The index of the smallest value is returned on line 8 where it says return min which shouldn't have any spaces and should be return minPosition;

The input array is given as an argument at the beginning of the function on line 2 where it says private static int positionMin (int] vals, int startPosition) {, as the variable vals.

This input array is also used as an argument on line 10 where it says Position; private static void swap(int] vals, int firstPosition, int secondPosition) and line 15 where it says vals[secondPosition] temp return public static void selSort(int| vals) {

You might be interested in
Explain how do compare and contrast graphic organizers help you to synthesize information?
Soloha48 [4]

Answer:

Answer: Given two or more sets of features of items, people, events, etc; compare and contrast graphic organizers help you to see what the sets have in common and what difference one set from the others, that is, what characteristics are unique from each set.

8 0
3 years ago
Read 2 more answers
What term refers to a celebrity or other popular figure publicly supporting a product?
IgorLugansk [536]

Answer:

Endorsement

Explanation:

The term that refers to this is known as an Endorsement. This can be for any product or service and generally involves a celebrity or public figure that in one way or another relates to the product or service being advertised. One example of this would be famous soccer icon Christiano Ronaldo publicly supporting and appearing in Nike advertisements showing off their new soccer cleats.

3 0
3 years ago
Need some help writing a simple PYTHON Student registration program:
Y_Kistochka [10]

import random

database = {}

while True:

   try:

       user_choice = int(input("Enter your student id to bring up your information (Press enter if you don't have one) : "))

       if user_choice in database:

           print("Student ID:",database[user_choice][0],"\nFirst name:",database[user_choice][1],"\nLast name:",database[user_choice][2],"\nPhone number:",database[user_choice][3],"\nEmail address:",database[user_choice][4],"\nPassword:",database[user_choice][5],"\nPoints:",database[user_choice][6])

   except ValueError:

       name = input("Enter your first name: ")

       last_name = input("Enter your last name: ")

       phone_number = input("Enter your phone number: ")

       email = input("Enter your email address: ")

       password = input("Enter a password: ")

       points = 100

       student_id = random.randint(1,1000)

       while student_id in database:

           student_id = random.randint(1,1000)

       print("Hello,",name,"your student ID is:",student_id)

       database[student_id] = [student_id,name, last_name, phone_number, email, password, points]

I wrote my code in python 3.8. I hope this helps.

6 0
2 years ago
What is the name for the strip of frequently used icons on a computer? O App O Program O Toolbar O Utilities panel ILL MARK YOU
liubo4ka [24]

Answer: The name of the strip is the Toolbar.

7 0
3 years ago
Read 2 more answers
When a router connects to and communicates over the internet, it has a ________ ip address that is routable over the internet.?
Bond [772]
It is a shared ip address
7 0
3 years ago
Other questions:
  • If you are trying move a hard drive from a non-working computer to a working computer for the purposes of accessing the data on
    5·1 answer
  • Write a program that uses an "if" statement to determine if the number is greater than one. If the number is greater than 1, the
    9·1 answer
  • The main purpose of a honeypot is Select one:
    12·1 answer
  • why might a portrait be both a portrait of the subject and the photographer? how is a photographer present in a portrait?
    10·2 answers
  • A ____ error occurs when the javascript interpreter encounters a problem while a program is executing.
    13·1 answer
  • Which computer company was named after an orchard? dell, apple, or ibm
    11·1 answer
  • In the view that follows, which field can't be updated create view example_2 as select invoice_number, invoice_date, invoice_tot
    13·1 answer
  • What is lasso tool write the name of any modelling and animation software<br>​
    8·1 answer
  • What number system do people in America use?
    10·2 answers
  • What tab should you choose if you want to practice presenting with your PowerPoint slides?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!