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
forsale [732]
2 years ago
10

Question 5 of 25

Computers and Technology
2 answers:
hammer [34]2 years ago
4 0

Answer: it’s c

Explanation:

Arisa [49]2 years ago
3 0

Answer: d

Explanation; Hopes this helps!!

You might be interested in
Write a Java class to perform the following: 1. Write a method to search the following array using a linear search, ( target ele
Alina [70]

Answer:

Check the explanation

Explanation:

Linear search in JAVA:-

import java.util.Scanner;

class linearsearch

{

  public static void main(String args[])

  {

     int count, number, item, arr[];

     

     Scanner console = new Scanner(System.in);

     System.out.println("Enter numbers:");

     number = console.nextInt();

   

     arr = new int[number];

     System.out.println("Enter " + number + " ");

     

     for (count = 0; count < number; count++)

       arr[count] = console.nextInt();

     System.out.println("Enter search value:");

     item = console.nextInt();

     for (count = 0; count < number; count++)

     {

        if (arr[count] == item)

        {

          System.out.println(item+" present at "+(count+1));

         

          break;

        }

     }

     if (count == number)

       System.out.println(item + " doesn't found in array.");

  }

}

Kindly check the first attached image below for the code output.

Selection Sort in JAVA:-

public class selectionsort {

   public static void selectionsort(int[] array){

       for (int i = 0; i < array.length - 1; i++)

       {

           int ind = i;

           for (int j = i + 1; j < array.length; j++){

               if (array[j] < array[ind]){

                   ind = j;

               }

           }

           int smaller_number = array[ind];  

           array[ind] = array[i];

           array[i] = smaller_number;

       }

   }

     

   public static void main(String a[]){

       int[] arr = {9,94,4,2,43,18,32,12};

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

       for(int i:arr){

           System.out.print(i+" ");

       }

       System.out.println();

         

       selectionsort(arr);

       

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

       for(int i:arr){

           System.out.print(i+" ");

       }

   }

}  

Kindly check the second attached image below for the code output.

Bubble Sort in JAVA:-

public class bubblesort {

   static void bubblesort(int[] array) {

       int num = array.length;

       int temp = 0;

        for(int i=0; i < num; i++){

                for(int j=1; j < (num-i); j++){

                         if(array[j-1] > array[j]){

                           

                                temp = array[j-1];

                                array[j-1] = array[j];

                                array[j] = temp;

                        }

                         

                }

        }

   }

   public static void main(String[] args) {

               int arr1[] ={3333,60,25,32,55,620,85};

               

               System.out.println("Before Bubble Sort");

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

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

               }

               System.out.println();

                 

               bubblesort(arr1);

               

               System.out.println("After Bubble Sort");

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

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

               }

 

       }

}  

Kindly check the third attached image below for the code output.

Binary search in JAVA:-

public class binarysearch {

  public int binarySearch(int[] array, int x) {

     return binarySearch(array, x, 0, array.length - 1);

  }

  private int binarySearch(int[ ] arr, int x,

        int lw, int hg) {

     if (lw > hg) return -1;

     int middle = (lw + hg)/2;

     if (arr[middle] == x) return middle;

     else if (arr[middle] < x)

        return binarySearch(arr, x, middle+1, hg);

     else

        return binarySearch(arr, x, lw, middle-1);

  }

  public static void main(String[] args) {

     binarysearch obj = new binarysearch();

     int[] ar =

       { 22, 18,12,14,36,59,74,98,41,23,

        34,50,45,49,31,53,74,56,57,80,

        61,68,37,12,58,79,904,56,99};

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

        System.out.print(obj.binarySearch(ar,

           ar[i]) + " ");

     System.out.println();

     System.out.print(obj.binarySearch(ar,19) +" ");

     System.out.print(obj.binarySearch(ar,25)+" ");

     System.out.print(obj.binarySearch(ar,82)+" ");

     System.out.print(obj.binarySearch(ar,19)+" ");

     System.out.println();

  }

}

Kindly check the fourth attached image below for the code output

7 0
2 years ago
Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "To
Ludmilka [50]

Answer:

#include <iostream>

using namespace std;

void PrintPopcornTime (int bagOunces){

   if (bagOunces < 2){

       cout << "Too small"<<endl;

   }

   else if (bagOunces > 10){

       cout << "Too large"<<endl;

   }

   else{

       cout << bagOunces*6 <<" seconds"<<endl;

   }

}

int main(){

   PrintPopcornTime(7);

   

   return 0;

}

Explanation:

Create a function called PrintPopcornTime that takes one parameter, bagOunces

Check the bagOunces using if-else structure. If it is smaller than 2, print "Too small". If it is greater than 10, print "Too large". Otherwise, calculate and print 6*bagOunces followed by " seconds".

Call the function in the main function with parameter 7. Since 7 is not smaller than 2 or not greater than 10, "42 seconds" will be printed.

4 0
2 years ago
Which group on the Home Ribbon allows you to add shapes to a PowerPoint slide?
skad [1K]
It is under the drawings group.  
8 0
3 years ago
Read 2 more answers
Dr. Wisteria is a prominent chiropractor in the Chicago area. She wants to provide a forum for her patients to discuss their hea
Svet_ta [14]

The best-suited telecommunications tool for Dr. Wisteria is a blog.

a blog

<u>Explanation:</u>

A blog can be defined as an informational website and more a platform for exchanging views and ideas about a particular topic.

There are various blogging platforms available. Dr. Wisteria should start writing blogs about health issues and in this way, she would be able to interact with all the people accessing the blog. People can also post their queries about their health issues and Dr. Wisteria can always reply to them.

This would also create a lot of awareness about any particular health issue being discussed as it is not necessary that only those people who want to post something will access the blog post, it can always be accessed by anyone.

5 0
2 years ago
Read 2 more answers
Write a function addUpSquaresAndCubes that adds up the squares and adds up the cubes of integers from 1 to N, where N is entered
avanturin [10]

Answer:

All functions were written in python

addUpSquaresAndCubes Function

def addUpSquaresAndCubes(N):

    squares = 0

    cubes = 0

    for i in range(1, N+1):

         squares = squares + i**2

         cubes = cubes + i**3

    return(squares, cubes)

sumOfSquares Function

def sumOfSquares(N):

    squares = 0

    for i in range(1, N+1):

         squares = squares + i**2

    return squares

sumOfCubes Function

def sumOfCubes(N):

    cubes = 0

    for i in range(1, N+1):

         cubes = cubes + i**3

    return cubes

Explanation:

Explaining the addUpSquaresAndCubes Function

This line defines the function

def addUpSquaresAndCubes(N):

The next two lines initializes squares and cubes to 0

    squares = 0

    cubes = 0

The following iteration adds up the squares and cubes from 1 to user input

    for i in range(1, N+1):

         squares = squares + i**2

         cubes = cubes + i**3

This line returns the calculated squares and cubes

    return(squares, cubes)

<em>The functions sumOfSquares and sumOfCubes are extract of the addUpSquaresAndCubes.</em>

<em>Hence, the same explanation (above) applies to both functions</em>

7 0
3 years ago
Other questions:
  • Which is NOT a type of SD card?
    8·2 answers
  • The _____ contains a series of sections designed to prepare students for the ACT
    14·2 answers
  • A _____ cloud allows an organization to take advantage of the scalability and cost-effectiveness that a public cloud computing e
    5·1 answer
  • When performing a basic search with Bing, you first type in your search expression and then click a button to begin the search;
    13·1 answer
  • True or False: It is illegal to park in a location that you block or create a hazard for other vehicles.
    11·2 answers
  • You have a chart that shows 100 data points and you've circled the highest value. Which of the following are you using?
    8·1 answer
  • Imagine you are responsible for making a presentation that includes a representation of the logic flow through a process. You un
    11·1 answer
  • In order to restrict editing to a document, a user will go to Review, , Restrict Editing, and will then select what kinds of edi
    12·1 answer
  • How to transfer bookmarks to new computer
    15·1 answer
  • Which tool can you use to display hardware utilization statistics that tell you about the operation of your computer?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!