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
yulyashka [42]
3 years ago
6

Consider the following code segment, where num is an integer variable.

Computers and Technology
1 answer:
posledela3 years ago
8 0

Answer:

Following are the complete code to the given question:

public class Main//main class

{

public static void main(String[] args) //main method

{

    int [][] arr = {{11, 13, 14 ,15},{12, 18, 17, 26},{13, 21, 26, 29},{14, 17, 22, 28}};//defining a 2D array

    int num=14;//defining an integer variable that holds a value 14

       for (int j = 0; j < arr.length; j++)//defining for loop to hold row value

       {

       for (int k = 0; k < arr[0].length; k++)//defining for loop to hold column value

       {

           if (arr[j][k] == num)//defining if block that checks num value

           {

               System.out.print(j + k + arr[j][k] + " ");//print value

           }

       }

       }

}

}

Output:

16 17

Explanation:

  • In the question, we use the "length" function that is used to finds the number of rows in the array.
  • In this, the array has the 4 rows when j=0 and k=2 it found the value and add with its index value that is 0+2+14= 16.
  • similarly when j=3 and k=0 then it found and adds the value which is equal to 3+0+14=17.
  • So, the output is "16,17".  
You might be interested in
What is the primary cause of the industrial revolution?
Whitepunk [10]

Explanation:

heyy

everyone come here for truth and dare

vzg-hqvy-wdn

5 0
3 years ago
Write a program for Horizon Phones, a provider of cellular phone service. Prompt a user for maximum monthly values for talk minu
Anarel [89]

Answer:

mport java.util.Scanner;

public class CellPhoneService

{

    public static void main (String args[])

    {

         Scanner sc=new Scanner(System.in);

         System.out.println("Enter the Talk minutes");

         int talkmin=sc.nextInt();

         System.out.println("Enter the text message");

         int textmsg=sc.nextInt();

         System.out.println("Enter the Gigabyte Data");

         int gbdata=sc.nextInt();

         if(talkmin<500 && textmsg==0 && gbdata==0)

         System.out.println("PLAN A IS RECOMMENDED FOR THIS USER at 49$ per month");

         else if(talkmin<500 && textmsg>0 && gbdata==0)

         {

              System.out.println("PLAN B IS RECOMMENDED FOR THIS USER at 55$ permonth");

         }

         else if(talkmin>=500 && textmsg<100 && gbdata==0)

         {

              System.out.println("PLAN C IS RECOMMENDED FOR THIS USER at 61$ permonth");

         }

         else if(talkmin>=500 && textmsg>=100 && gbdata==0)

         {

              System.out.println("PLAN D IS RECOMMENDED FOR THIS USER at 70$ permonth");

         }

         else if(gbdata>0 && gbdata<2)

         {

              System.out.println("PLAN E IS RECOMMENDED FOR THIS USER at 79$ permonth");

         }

         else if(gbdata>=2)

         {

              System.out.println("PLAN F IS RECOMMENDED FOR THIS USER at 87$ permonth");

         }

    }

}

Explanation:

  • Take the talk minute and text message as input from user.  
  • Apply the conditional statement to check if talk minute is less than 500 along with text message and GB data having a value 0.
  • At last check if GB data is greater than or equal to 2, then print the relevant response.
3 0
4 years ago
1. What does the term 'in season' mean?
yKpoI14uk [10]
Available at the time of year.
8 0
3 years ago
Read 2 more answers
Which of the following statements is true about scalability? Choose 3 options.
Simora [160]

Answer:

4, 5, 2

Explanation:

just did it on edge :)

3 0
3 years ago
Read 2 more answers
A small company has a web server in the office that is accessible from the internet. the ip address 192.168.10.15 is assigned to
vaieri [72.5K]
the ip nat inside source command to link the inside local and inside global addresses

I hope this helps! :)
5 0
3 years ago
Other questions:
  • ________ are devices used to send data between two networks.
    11·1 answer
  • How is informatics affecting banking and financial institutions?
    13·1 answer
  • In three to five sentences, describe how technology helps business professionals to be more efficient. Include examples of hardw
    10·1 answer
  • The create_python_script function creates a new python script in the current working directory, adds the line of comments to it
    9·1 answer
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • __________ is a program that lets you share documents online with others.
    12·2 answers
  • It is unlawful in the State of Florida for any person, ______________________, to be a passenger in the front seat of a motor ve
    7·1 answer
  • The simplest element that exists is only one proton and one electron. It is what stars are made of. It's symbol is "H". What is
    9·1 answer
  • Which of the following are drivers of machine learning growth?
    15·1 answer
  • Classes that depend on field names from parent classes are said to be ____ because they are prone to errors.Group of answer choi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!