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
fgiga [73]
3 years ago
10

Write a program that responds to a positive integer passed on the command line with the number of bits needed to express that nu

mber in binary.
Computers and Technology
1 answer:
jolli1 [7]3 years ago
7 0
You may want to rephrase the output.

```
#!/usr/local/bin/python3

### Written for Python version 3! ###

import sys

num = int( sys.argv[ 1 ] )
exp = 0

while( num > 2**exp ):
    exp += 1

print( "It takes %d bits to get to the center of a Tootsie Roll" % exp )

exit( 0 )
```


You might be interested in
7. Which innovation in video games do you think has been most significant? Include at least one way that innovation affects the
GarryVolchara [31]

Answer:

Virtual reality has been one of the most significant innovation in video games.

Explanation:

Virtual reality is a simulated experience that can be similar to or completely different from the real world. It has totally revolutionized the way we play and experience the world created inside of a game.  On a computer, virtual reality is primarily experienced through two of the five senses: sight and sound.

The whole gaming experience can elevate users confidence & sense of pride. There are VR games that will help you to get a good idea of what it feels to face a big white shark as it develops realistic scenarios. That's why virtual reality has been one of the most significant innovation in video games.

8 0
4 years ago
Legal functions are the most important area of IG impact. Under the FRCP amendments, corporations must proactively manage the e-
AfilCa [17]

Answer:It can jeopardize your chain of custody, but also expose sensitive data to the wrong people.

Explanation:

6 0
3 years ago
ASAP HELP NO GUESS A new pet store wants to design a logo to be displayed on business cards, posters in the shop’s windows, and
murzikaleks [220]

[2] JPG graphic  i hope this helps

6 0
3 years ago
Read 2 more answers
Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint:
Alika [10]

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main()//defining main method

{

int x[]={2,3,4,6,7,8,9,1,11,12};//defining 1-D array and assign value

int i,sum=0;//defining integer variable

for(i=0;i<10;i++)//defining loop for count value

{

   if(x[i]%2==1)//defining if block to check odd value

   {

       sum=sum+x[i];//add value in sum variable

   }

}

cout<<sum;//print sum

return 0;

}

Output:

31

Explanation:

In the above-given program, an integer array "x" is declared that holds some integer values, and in the next line two integer variable "i and sum" is defined which is used to calculate the value.

In the next line, a for loop is declared, that counts all array value, and it uses the if block to check the odd value and add all the value into the sum variable.

5 0
3 years ago
A ____________ would be a misconfiguration of a system that allows the hacker to gain unauthorized access, whereas a____________
Lynna [10]

Answer:

vulnerability, risk

Explanation:

A vulnerability would be a misconfiguration of a system that allows the hacker to gain unauthorized access, whereas a risk is a combination of the likelihood that such a misconfiguration could happen, a hacker’s exploitation of it, and the impact if the event occurred.

6 0
3 years ago
Other questions:
  • You disassemble and reassemble a desktop computer. when you first turn it on, you see no lights and hear no sounds. nothing appe
    11·2 answers
  • What is binary in computer science ​
    11·1 answer
  • Obtain a file name from the user, which will contain data pertaining to a 2D array Create a file for each of the following: aver
    5·1 answer
  • Megan has written the following rough draft for her assignment. Choose the correct way to complete each sentence. Sarah is creat
    13·1 answer
  • Hard light is usually not good for filming. True False
    11·2 answers
  • Callie Crystal owns and operates one of the most successful local coffee shops in Denver, called The Edgewater Café. Each time a
    5·2 answers
  • Consider the following statement from the CS Principles course framework: The global distribution of computing resources raises
    12·1 answer
  • Ten examples of an interpreter
    8·1 answer
  • Please what do you guys think about this ?
    10·2 answers
  • Convert alzebric expression into basic expression<br> (1/2)bh<br> PLEASE GIVE ANSWER FAST
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!