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
Yanka [14]
3 years ago
7

Give a tight bound on the number of times the z = z + 1 statement is executed. i = 2 while ( i > 1 ) { i = floor(i/2) z = z +

1 }
Computers and Technology
1 answer:
Alinara [238K]3 years ago
4 0

Answer:

zero ( 0) times.

Explanation:

In the code;

i = 2

while ( i > 2){

     i = floor( i/2 );

     z = z + 1;

}

the variable " i " is assigned the integer " 2 ", then the while statement loops with a condition of a greater " i " value and divides the value by two for every loop.

But in this case, the while statement is not executed as the value of " i " which is 2 is not greater than but equal to two.

You might be interested in
Which of the selection below does not represent a workable IP address?
gogolik [260]

Answer:

ipv4 ip addresses will be 4 sets of numbers to a maximum of 255 per set ie the highest ipv4 number is 255.255.255.255 ipv6 use hexadecimal and has many more addresses ie ipv6 0:0:0:0:0:ffff:ffff:ffff is = to ipv4  255.255.255.255

Explanation:

8 0
3 years ago
Write a program called DeliveryCharges for the package delivery service. The program should use an array that holds the 10 zip c
Vlad [161]

Answer:

import java.util.Scanner;

public class DeliveryCharges

{

public static void main(String[] args) {

 

       String[] zips = {"01234", "11234", "21234", "31234", "41234", "51234", "61234", "71234", "81234", "91234"};

    double[] prices = {2.2, 1.0, 3.6, 6, 9, 7.1, 0.8, 4.7, 3.3, 5.2};

    int index = -1;

    Scanner ob = new Scanner(System.in);

    System.out.print("Enter the zip code for your delivery: ");

    String zip = ob.next();

   

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

        if (zip.equals(zips[i])) {

            index = i;

        }

    }

       

    if (index!= -1)

       System.out.println("Delivery charge to " + zips[index] + " is: " + prices[index]);

    else

       System.out.println("No delivery to " + zip);

}

}

Explanation:

Initialize the zips and prices

Initialize index that represents the index of the zip code. If the entered zip code is in the array

Ask the user to enter the zip code

Create a for loop that iterates through the zips. If the entered zip is in the zips, set its index to index

When the loop is done, check if the index. If the index is not -1, that means zip code was found in the zips array, print the corresponding price from the price array. Otherwise, print no delivery for the entered zip code

8 0
4 years ago
Which of these is NOT an advantage of the impact of computer careers.
nikdorinn [45]
I believe the answer could be the first choice. I'm not quite sure, though
4 0
3 years ago
Read 2 more answers
Analyze the given word pattern and choose the correct option.
frozen [14]

Answer:

The code for DOOR would be <u>3775</u>.

Explanation:

WORD - 9753

W - 9

O - 7

R - 5

D - 3

DOOR: 3775

5 0
2 years ago
What should be used when performing vehicle maneuvers?
IrinaVladis [17]

a wand .............

7 0
4 years ago
Other questions:
  • The procedure call mystery(38) will yield which output? __________ a) 0 12 b) 12 0 c) 1 1 0 2 d) 1 1 1 1 e) 2 0 1 1 public void
    11·1 answer
  • 1. The best program to present numerical data in would be ____. a. Access c. PowerPoint b. Excel d. Word
    6·1 answer
  • A contact list is a place where you can store a specific contact with other associated information such as a phone number, email
    8·1 answer
  • There are four types of alignment available from on the Home ribbon toolbar. They include all of the following except
    13·1 answer
  • Making an analogy between Freudian theory and the brain networks described in an earlier chapter in the text, primary process th
    10·1 answer
  • Would increasing your ROM, increase the efficiency of a computer system.
    11·1 answer
  • Examples of the many different ways an app can be used are called use
    6·2 answers
  • All of the data in a digital book (letters, punctuation, spaces, etc) are stored and processed in a computer as binary. Break do
    15·1 answer
  • Can yall help me pls
    12·1 answer
  • What is a symbol such as a heavy dot or another character that precedes a text in a power point
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!