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
Stells [14]
2 years ago
11

What is the output for the following program?

Computers and Technology
1 answer:
Lelu [443]2 years ago
6 0

Answer:

Output:

15

20

25

Explanation:

In first iteration value of num is 10. Condition is checked 10 is less than 21 so value of num is incremented by 5 and value 15 is printed than again condition is checked 15<21 so value of num is incremented again and 20 is printed. Again condition is checked 20<21. So 25 is printed. Then 4th time when condition is checked vakue of num is 25 and while loop condition becomes false because 25 is not less than 21 and program is terminated here.

You might be interested in
Which term describes the second core IPSec security protocol; it can perform authentication to provide integrity protection, alt
Sphinxa [80]

Answer:

Encapsulating Security Payload (ESP)

Explanation:

Encapsulating Security Payload is also known as ESP, it is a protocol that exists within IPSec, it helps in determining the authentication, integrity and how confidential network pack data / Payload in IPV4 and IPV6 networks are.

ESP supplies messages /Payload encipher, it also helps in authenticating Payload as well as where it originated from in the IPSec protocol suite.

6 0
3 years ago
Write a program that reads a 4-bit binary number from the keyboard as a string and then converts it into decimal. For example, i
adell [148]

Answer:

import java.util.Scanner;

public class ss11{

       public static void main (String[]args) {

             Scanner keyboard = new Scanner (System.in)

             String a1, a2, a3, a4, a5;

              int i1, i2, i3, i4, i5;

              System.out.println("Enter a four bit binary number:");

               a1= keyboard.next();

               a2= a1.substring(0,1);

               a3= a1.substring(1,2);

               a4= a1.substring(2,3);

               a5= a1.substring(3,4);

                i1 = Integer.parseInt(a2);

                i2 = Integer.parseInt(a3);

                i3 = Integer.parseInt(a4);

                i4 = Integer.parseInt(a5);

                i1= i1 * 8;

                i2= i1 * 4;

                i3= i1 * 2;

                i4= i1 * 1;

                i5= i1+i2+i3+i4;

                System.out.println("The converted decimal number is: +i5);

}

}

Explanation:

7 0
3 years ago
Int [] val = { 3, 10, 44 };
irina1246 [14]

Answer:

5) 3 0 0

Explanation:

Given data

int [] val = { 3, 10, 44 };

The total number of parameters of given array are 3, so total length of array is also 3.

The indexing of array starts with '0', Therefore the indexes of array with length zero are: {0,1,2}

The value of array at index 0 is = 3

similarly

value at index 1 = 10

value at index 2 = 44

Here, Int i = 1 is storing the value '1' in integer variable i.

In addition to that, any value of index 'i' of an array is selected using array[i].

Therefore,

val[i] = i-1 is copying the value (i-1 = 1-1 = 0) to the index '1'  of the array because i = 1.

So value at index 1 would be = val[1] = 0

The term i++ is incrementing the value of i, it makes i =2

val[i] = i-1 is copying the value (i-1 = 1-1 = 0) to the index '2' of the array because i = 2 now.

So value at index 2 would be = val[2] = 0

Hence, the output would be {3 0 0}. So 5th option is correct.

4 0
2 years ago
Time-management techniques work most effectively when performed in which order?
Sholpan [36]

Answer:

study-time survey, project schedule, prioritize tasks, reward system.

Explanation:

Time management can be defined as a strategic process which typically involves organizing, planning and controlling the time spent on an activity, so as to effectively and efficiently enhance productivity. Thus, when time is properly managed, it avails us the opportunity to work smartly rather than tediously (hardly) and as such making it possible to achieve quite a lot within a short timeframe. Also, a good time management helps us to deal with work-related pressures and tight schedules through the process of properly allocating the right time to the right activity.

Hence, time-management techniques work most effectively when performed in the following sequential order; study-time survey, project schedule, prioritize tasks, and designing (creating) a reward system.

4 0
3 years ago
Add a data attribute tricks of type list to each Dog instance and initialize it in __init__ to the empty list. The user does not
Olenka [21]

Answer:

Following are the method to this question:

def __init__(self, _name, _breed):#defining Constructor

       """ Constructor """

       self.name = _name#assigning value in name variable

       self.breed = _breed#assigning value in breed variable

       self.tricks = []#defining tricks an empty list

Explanation:

In the above code, a parameterized constructor is defined, that hold two-variable "name and breed" in its parameter, and another object self is created for storing the value.

Inside the constructor two-variable, and one empty list variable "tricks" is defined that hold value in the name and breed variable, and the next step an empty list is defined, that store its value.

7 0
2 years ago
Other questions:
  • Reputable firms often ask recent graduates to pay an up-front fee for a job.
    12·2 answers
  • What file format can excel save files as
    10·1 answer
  • What type of machine is a CD player? A. simple machine B. compound machine
    8·2 answers
  • According to ________ law, in a sealed chamber, the pressure and temperature of a gas are directly related to each other.
    10·1 answer
  • 2. Sometimes, validating the HTML code for a web page will help you debug an application, because a. the page won’t run in a bro
    10·1 answer
  • Please help!!!
    9·2 answers
  • Y'+2y = 5-e^(-4x), y(0)=-11
    9·1 answer
  • Two forms of compression are lossy and lossless. State giving reasons which
    8·1 answer
  • Table Setting in any occasion can add to the beauty and significance of the event. It may
    6·1 answer
  • Need help finding the totals and with the empty spots
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!