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
hodyreva [135]
3 years ago
8

Write a Python program that translates a binary number of n bits to a decimal number. Your program should first ask the user the

length of the binary number (how many bits). Using that information, ask the user to provide each bit from lowest to highest. Once the user has entered all the bit values for the binary number, report back the decimal value. Hint: You should use the mechanism to convert binary to decimal in earlier lectures. Note: Your program should not use any functions or methods from any library.

Computers and Technology
1 answer:
KonstantinChe [14]3 years ago
3 0

Answer:

Follows are the code to this question:

n= int(input("please enter number of bits, which want to convert for binary to decimal numbers: "))

p= 1#defining variable p for calculate power

d= 0#defining variable d for calculate decimal value

for i in range(n):#defining for loop for input bits value

   b= int(input("Enter the bit value from lowest to highest: "))#input value in b

   if b==1:#defining if block that check input is 1 value

       d=d+p#calculating decimal value

   p=p* 2#calculating power

print("The converted decimal number is:",d)#print value

Output:

please find the attached file.

Explanation:

In the above-given code, n variable is defined, which takes the number of bits value which you want to convert into a decimal value.

In the next step, "d and p" variable is defined that calculates the power and decimal number and store its value respectively, in this step, a for loop is used that uses the "b" variable for inputs bits value into lowest to the highest form, and use the if block.

In this block, it checks if the input value is one then it calculates its power and store its value into the "d" variable and use the print method to print its value.  

You might be interested in
You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
dezoksy [38]

Answer:

MAC (Mandatory access control)

Explanation:

Mandatory access control is a type of access control.MAC is a strategy that are defined by system administration. MAC access is controlled by administration.  Administrative security access training, security awareness , written policies and procedures, incident response plan , agreements and background checks.                        

4 0
3 years ago
Write a Python program that uses three variables. The variables in your program
ZanzabumX [31]

Answer:

animal = "animal"

vegetable = "vegetable"

mineral = "mineral"

print("Here is an ")

print(animal + ",")

print("a " + vegetable + ",")

print("and finally "mineral)

Have a nice day!

Please mark as brainiest :)

7 0
2 years ago
Which protocol is often used in conjunction with ipsec to provide a remote access client vpn with user authentication?
amid [387]

The L2TP or Layer 2 Tunneling Protocol is often used in conjunction with ipsec to provide a remote access client vpn with user authentication.

<h3>What is vpn?</h3>

VPN is known as a Virtual Private Network extends a private network across a public network and activates users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network.

The main difference between VPN proxy and a VPN is encryption and VPNs hides all the web activities performed by the user as well as user's private IP address.

Therefore, the L2TP or Layer 2 Tunneling Protocol is often used in conjunction with ipsec to provide a remote access client vpn with user authentication.

Learn more about VPN here:

brainly.com/question/17272592

#SPJ4

3 0
2 years ago
Which function would you use to make sure all names are prepared for a mailing label? TODAY UPPER PROPER LOWER
Aleonysh [2.5K]

Answer:

Proper.

Explanation:

5 0
2 years ago
Hank is the network administrator responsible for managing the web server cluster for an e-commerce company. He’s worried about
statuscvo [17]

Answer: ....

If one load balancer fails, the secondary picks up the failure and becomes active. They have a heartbeat link between them that monitors status. If all load balancers fail (or are accidentally misconfigured), servers down-stream are knocked offline until the problem is resolved, or you manually route around them.

Explanation:

Load balancing is a technique of distributing your requests over a network when your server is maxing out the CPU or disk or database IO rate. The objective of load balancing is optimizing resource use and minimizing response time, thereby avoiding overburden of any one of the resources.

The goal of failover is the ability to continue the work of a particular network component or the whole server, by another, should the first one fail. Failover allows you to perform maintenance of individual servers or nodes, without any interruption of your services.

It is important to note that load balancing and failover systems may not be the same, but they go hand in hand in helping you achieve high availability.

3 0
3 years ago
Other questions:
  • Whats your favorite sport between these options?
    12·2 answers
  • You may be guilty of plagiarism even if
    13·1 answer
  • Technician A says you should measure the parasitic load immediately after the vehicle is turned off. Technician B says you shoul
    10·1 answer
  • which of these describe raw data?check all of the boxes that apply A) what a person buys B) where a person lives C) data that ha
    9·1 answer
  • ) Doyou know applets and Java Beans in Java? Please briefly state eachone with an example.
    10·1 answer
  • An IT firm came across a startup company that offers a new system of computer storage. It is currently in the experimental phase
    11·1 answer
  • Which camera mode gives the photographer the greatest amount of control?
    7·2 answers
  • 20 POINTS AND BRAINLIEST TO CORRECT ANSWER
    15·2 answers
  • A website for a certain political party or candidate is likely to have unbiased
    6·1 answer
  • Convertbinary(111100)to decimal​​​​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!