python
Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:
As long as x is greater than 0
Output x % 2 (remainder is either 0 or 1)
x = x // 2
Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string.
Ex: If the input is:
6
the output is:
110
The program must define and call the following two functions. Define a function named int_to_reverse_binary() that takes an integer as a parameter and returns a string of 1's and 0's representing the integer in binary (in reverse). Define a function named string_reverse() that takes an input string as a parameter and returns a string representing the input string in reverse.
def int_to_reverse_binary(integer_value)
def string_reverse(input_string)
main.py
# Define your function here.
if __name__ == '__main__':
# Type your code here. Your code must call the function.

Answers

Answer 1

The program illustrates the use of loops .

Loops are used for operations that must be repeated until a certain condition is met.

How to write the program?

The program written in Python, where comments are used to explain each action is as follows:

#This defines the int_to_reverse_binary function

def int_to_reverse_binary(integer_value):

   #This initializes the string output

   strNum = ""

   #The following loop calculates the string output

   while (integer_value > 0):

       strNum += str(integer_value % 2)

       integer_value //= 2

   #This passes the string output to the string_reverse function

   string_reverse(strNum)

#This defines the string_reverse function

def string_reverse(input_string):

   #This reverses the string

   strRev = input_string[::-1]

   #This prints the reversed string

   print("Binary number:",strRev)

# The main begins here

if __name__ == '__main__':

   #This gets the decimal value

   dec_val = int(input("Decimal value: "))

   #This calls the int_to_reverse_binary function

   int_to_reverse_binary(dec_val)

   

Read more about Python programs at:

https://brainly.com/question/24833629


Related Questions

Pauline has a well-established app with a large user base. Now she needs new users who complete valuable actions within the app. What phase does this fall under?

Answers

Answer:

Maturity because if you want new users who will complete [valuable]  actions they need to be [Mature].

Explanation:

send link for a qc or paddle

Answers

Answer:

heres a few paddles, i dunno which one you want so i put a few.

Explanation:

Blake is on the fast track and hopes to get a promotion soon. he wants to make sure that he is always able to
work at peak proficiency on the job. he has done a great deal of work and has numerous essential files that are
crucial to his job. he uses this utility to make sure these files are saved on the office's external hard drive.

a.remote control
b.firewall
c.file compression
d.backup

Answers

Answer:

D

Explanation:

How do you answer this ?

Answers

Answer:

Just put True or false for your answer

Explanation:

Use a Dictionary

What is a critical consideration on using cloud-based file sharing and storage applications.

Answers

Answer:

a critical consideration on using cloud-based file sharing and storage applications on your Government-furnished equipment (GFE)? Determine if the software or service is authorized. A coworker wants to send you a sensitive document to review while you are at lunch and you only have your personal tablet.

Pls mark me as brainlist

This is a critical consideration on using cloud-based file sharing and storage applications to determine that Determine the software program or provider is authorized.

What are the Indicators ?

It is of a capability insider chance may be damaged into 4 categories--signs of: recruitment, facts collection, facts transmittal and preferred suspicious behavior.

Determine if the software program or provider is authorized. A coworker desires to ship you a touchy record to study even as you're at lunch and also you most effectively have your private tablet.

Read more about the cloud-based file:

https://brainly.com/question/24228581

#SPJ2

Which one of these actions isn't a valid way to update the status of a lead? A. Click "Mark Status as Complete" in Path. B. Click the desired step on the Path, then click "Mark Current Status." C. View the lead record, click "Edit," and change the Status field. D. Change the Kanban settings Group By to "status." Drag the record to a different column. E. In any list view, click "Shuffle" to change up every record's status.

Answers

The action that is not  a valid way to update the status of a lead is that In any list, click "Shuffle" to change up every record's status.

How do I update lead status?

To update any  lead from a list view such as one that is found in Salesforce One has to select the leads that the person want to edit and then by double-clicking the specified field value and then make the change that you want.

Note that the update  differs for others and the action that is not a valid way to update the status of a lead is that In any list, click "Shuffle" to change up every record's status. This is wrong.

Learn more about update from

https://brainly.com/question/10106963

How to give the the crown?
Can show a video if you can or photos!

Answers

Answer:

The crown is called the Brainliest award. If two people had given you answers then there is a option of mark as Brainliest. Click there in the option of mark as Brainliest in which you like the answer most. If any one person has given answer then after some days you will a notification to mark his/her answer as Brainliest. By this you can mark an answer as Brainliest.

Please have a great day, and have fun giving people Brainliest answers <3

A flowchart is a useful visual that can __________.a. be used to show spatial relationships.b. be used to show frequency or distribution of parts in a whole.c. be used to show trends in one or more variables.d. be used to illustrate processes or procedures.

Answers

Explanation:

in my book flowchart is a graphical symbolic representation of computer

A citizen of any group has both _____ and _____.

Answers

Answer:

rights and responsibilities

Explanation:

Answer: Down below

Explanation:

Consider the following recursive method. public static string recur(int val) { string dig = "" + (val % 3); if (val / 3 > 0) return dig + recur(val / 3); return dig; } what is printed as a result of executing the following statement? system.out.println(recur(32));

Answers

The recursive method recur executes itself from within

When the statement System.out.println(recur(32)); is executed, the string value "2101" is printed

How to determine the output of the statement?

The flow of the program is as follows:

The method keeps updating the string variable dig with the remainder of the val variable divided by 3When the remainder is less than or equal to 0, the method is exited

So, when 32 is divided by 3.

The remainders are 2, 1, 0 and 1

So, the output of the statement is "2101"

Read about java methods at:

https://brainly.com/question/19271625

W
tickets for tsg airlines are coded as follows:
• united kingdom flights are coded a, european flights b, asian
flights c, and american flights d.
overnight flights between 10pm and 6am use the same codes,
but with lower case letters (a, b, c, d)
• male passengers are coded x and female passengers are coded
y
• children under 16 are coded lowercase (x, y)
• meals are coded vegetarian v, beef b, and chicken k
• first class passengers are a, business class are b, and economy
is c
what is the code for a flight from chicago to new york at 5am for a
vegetarian 8 year old girl traveling in economy class?

Answers

The flight code of the tsg airlines is an illustration of computer coding

The code of the flight is AayvC

How to determine the code of the flight?

From the question, we have the following parameters:

UK = A, Europe = B, Asian = C, and the Americas = D.Flight between 10 pm and 6 am = (a,b,c, and d)Male passengers = X;  Female passengers = Y.Children under 16 = (x.y)Vegetarian Meal  = v; Beef = b, Children = KFirst Class = A, Business Class = P; Economy = C

To code the flight of the girl, we have the following parameters:

Destination =UK; UK code is ATime = 5AM; UK flight before 6AM is coded aFemale children under 16 is coded yMeal = vegetarian; The code for this is vEconomy class is coded C

Hence, the code of the flight is AayvC

Read more about coding at:

https://brainly.com/question/24735155

write the algorithms for the problem How to post a letter ? you can put pictures for the steps ​

Answers

❖ Step 1: Start

❖ Step 2: Write a letter

❖ Step 3: Put in envelope

❖ Step 4: Paste stamp

❖ Step 5: Put it in the letter box

❖ Step 6: Stop

[tex]\frak{\fcolorbox{black}{pink}{Black Pink in your area$~$}}[/tex] ~←(>▽<)ノ

Fill in the blanks to explain another memory Grandpa shares with
Amara

Answers

The answers to the fill in of blanks to explain another memory Grandpa shares with Amara are

Young RecentlyOnly moments ago

What is  blank statement?

A blank statement is known to be a kind of empty statement where some information are said to be missing.

In the text above, . "Even though her Grandfather had passed away when Gina was little young" and Recently, her memories of him are still as fresh as the bakers bread."

Learn more about blanks  from

https://brainly.com/question/25573309

A new cybersecurity analyst is working at their first job. the analyst requires a penetration test reporting and evidence gathering framework that can run automated tests through integration with metasploit. recommend a framework that will fulfill the analyst's needs.

Answers

The Recommendations of a framework that will help to fulfill the analyst's needs is that he or she should not use Sn1per.

What is Sn1per?

The term Sn1per is known to be a form of automated scanner that is able to be employed in a penetration test.

It is often used to list out and scan for any form of  vulnerabilities. The use of Sn1per will  fulfill the analyst's needs in terms of that framework.

Learn more about test reporting from

https://brainly.com/question/6076728

Which of the following is an example of a moving method?

Answers

Which of the following is an example of an urgent move?

rapid extrication technique

How to ignore punctuation before and after a word javascript

Answers

Answer:

If you want to remove/ ignore punctuation before and after a word javascript, my suggestion is to remove specific punctuation from a string, it will probably be best to explicitly remove exactly what you won't like.

A company has employees who write down passwords, which should be kept private, on sticky notes. Given this scenario, what should the IT security department implement to prevent this type of mishandling of confidential information

Answers

Save the passwords to an encrypted database, saving the passwords as hash values to keep confidentiality.

Lattice-based access controls use a two-dimensional matrix to assign authorizations. What are the two dimensions and what are they called

Answers

Answer:

riesige Pyramide

Explanation:

riesige Pyramide

A Lattice-based access controls is used to value derivatives by employing a binomial tree to calculate the various ways the price of an underlying asset, such as a stock, might take over the derivative's life.

What are Lattice-based access controls?

In computer security, lattice-based access control exists as a complex access control model established on the relations between any assortment of objects and subjects.

A Lattice-based access controls is used to value derivatives by employing a binomial tree to calculate the various ways the price of an underlying asset, such as a stock, might take over the derivative's life. The binomial tree plots out the potential values graphically that alternative prices can have over additional time periods.

Three primary kinds of access control systems exist Discretionary Access Control (DAC), Role Based Access Control (RBAC), and Mandatory Access Control (MAC).

There are two kinds of access control: physical and logical. Physical access control limitations access to campuses, buildings, rooms, and physical IT assets. Logical access control limitations connections to computer networks, system files, and data.

To learn more about Lattice-based access controls refer to:

https://brainly.com/question/14982444

#SPJ2

30 POINTS!!!! HELPPPPP!!! in computer science, what does the term inference mean?
a. the wiring connection between the computer and all of its hardware devices
b. an internal switch inside the monitor that dims the screen's brightness at sunset
c. a device or program that allows a user to communicate with a computer
d. a sensor that turns the computer fan on when the computer gets too hot

Answers

Answer:

A. The act or process of reaching a conclusion about something from known facts

Hope this helps you!

Please Mark me Brainlest!!

Answer: c. a device or program that allows a user to communicate with a computer

Explanation:

A(n) ________ area network is a type of wireless network that works within your immediate surroundings to connect cell phones to headsets, controllers to game systems, and so on. A(n) ________ area network is a type of wireless network that works within your immediate surroundings to connect cell phones to headsets, controllers to game systems, and so on. wide personal local gateway

Answers

A personal area network is a type of wireless network that works within your immediate surroundings.

What is a personal area network?

A personal area network (PAN) is known to be a kind of computer network that has been made to function as an interconnecting electronic devices that is also found within an person's own workspace.

Note that a PAN is one that gives or helps in data transmission among devices such as computers, smartphones, etc.

Learn more about personal area network from

https://brainly.com/question/1167985

Social media tools allow you to connect with people anywhere in the world who share your interests evaluate your interactions with people living outside the United States using various Social media tools how his influences how do you break cultural stereotypes and discover the local activities career aspirations in sports preferences of people from other cultures what is a social media tools that you used to form these connections explain how these connections have been influenced you, providing specific examples

Answers

The social media tools that you used to form these connections are:

Buzz Sumo. Go ogle Trends. Buffer Publish.Can va. Un splash

What are social media tools?

Social media tools are known to be key tools that are used for the running of business so as to handle important ways in their Digital Marketing routine.

The social media tools are important because it helps one to plan ahead and also  ensure that a person post the type of content needed to reach your goals and grow one's business.

Learn more about  social media from

https://brainly.com/question/3653791

The page that appears when you first open your Internet browser is the _____.


opening page
opening page

launch page
launch page

home page
home page

first page
first page

Answers

Answer:

i think it's opening page

Answer:

i think its also opening page

Explanation:

Match up each definition and term. Please help asap

Answers

Answer:

Query - Definition - Search by specific information Example - Find T-shirt in a specific size

Flat File Database - Definition - Simple database where each row is a record Example - Excel file of names and addresses

Fields - Definition - Different types of data for each record (columns) Example - Type of clothing, colour, size, price

Sort - Definition - Show records in different order based on its fields Example - Arrange all records alphabetically by colour

Record - Definition - Main item in a list (row) Example - Jeans

Text Field - Definition - Any number, letter, and all symbols Example - Levi's 518

Date Field - Definition - Date in a specific format Example - 2020-06-30

TIME Field - Definition - Any format of a timestamp Example - 10:42 PM

Graphic Field - Definition - Any kind of image Example - Logo

Calculated Field - Definition - Contains a formula to work something out Example - Length of time item has been in inventory

Number Field - Definition - Contains numbers that may be used in future calculations Example - $237.42

Brainlist Pls!

What is the name for the base-2 system used by computers to represent
data?
O A. Unicode
O B. Binary code
C. Hexadecimal code
D. Decimal code

Answers

Answer:

B. Binary Code

Explanation:

Binary code is the base-2 system used by computers to represent data. Binary code consists of 0's and 1's which can be used to represent states such as on or off; go or no-go and more.

Look at the color key below the map that shows the overall performance range. What is the range for 1 Year Performance? How does it compare to the 1 Day Performance range?

Answers

A performance range simply means the threshold and maximum percentage of shares that may become earned.

What is a performance range?

Your information is incomplete. Therefore, an overview will be given. A performance range is the maximum percentage if shares that may become earned shares due to the attainment of the requirements of the performance.

It should be noted that in this case, the opportunity to incentivize performance will be associated with the relative performance.

Learn more about performance on:

https://brainly.com/question/26256535

A pointing device used mainly for computer games is known as
A.stylus
B.Digitizer
C.joystick

Answers

Answer: Joystick is the only one that makes sense, a stylus and digitizer are both used on drawing tablets, not computer games.

The first time you save a file, there is no difference between the Blank Space __________ and Save As commands.

Answers

I think the answer is save.

Hope that helps!

Give 3 reasons why it is believed that smart phones precent us from communicating face to face.give three reasons why it is believed that smartphones prevent us from communicating face to face ​

Answers

Answer:

yes

Explanation:

because the people will be lazy to go and talk to that person instead They will call each other and discuss

What element allows text to be displayed in italics, which means the words are slanted to the right?

a
The < crooked > element

b
The < italic > element

c
The < em > element

d
The < slant > element

Answers

Answer:

the answer is the italic element

_______ are malicious programs that come into a computer system disguised as something else such as a free computer game or screen saver.

Answers

Answer:

Trojan horses

Explanation:

Other Questions
Jake is tiling his bathroom floor. He uses three green tiles for every white tile. Jake uses twenty four tiles in total. How many of them are green? How may you rethink the way you choose people in a group? No links please or I will report you. The best explanation gets Brainliest! Which of the following microbial growth mediums would be used to sample for fungi bacterial growth in the sterile environment ? a) MacConkey agar b) Trypticase soy agar c) Tryptone glucose extract agar d) Bacteriological agar Rods and cones are similar in that they both _____. Diffusion is:the process of a concentrated substance moving into an area of lower concentration.the rate at which oxygen is taken in by the alveoli and used by the body.a type of cell that transports oxygen and carbon dioxide.a cluster of air-filled sacs that move oxygen through the body. Which is the inverse of the function f(x) = 4x 9? change into reported speech 1. sudha said to I saw you put the note in your pocket The county collector of suncoast county is responsible for collecting all property taxes levied by funds and governments within the boundaries of the county. to reimburse the county for estimated administrative expenses of operating the tax agency fund, the agency fund deducts 1.5 percent from the collections for the town, the school district, and the other towns. the total amount deducted is added to the collections for the county and remitted to the suncoast county general fund.the following events occurred in 2017:1.current-year tax levies to be collected by the agency were: county general fund$10,333,000 town of bayshore general fund4,840,000 suncoast county consolidated school district6,550,000 other towns3,120,000 total$24,843,0002. $13,700,000 of current taxes was collected during the first half of the year. 3. liabilities to all funds and governments as a result of the first half-year collections were recorded. (a schedule of amounts collected for each participant, showing the amount withheld for the county general fund and net amounts due the participants, is recommended for determining amounts to be recorded for this transaction.) 4. all cash in the tax custodial fund was distributed. all additions and deductions were recorded by the custodial fund. additions and deductions are aggregated because resources are held less than three months.requireda. prepare journal entries for each of the foregoing transactions that affected the tax agency fund. (if no entry is required for a transaction/event, select "no journal entry required" in the first account field. do not round intermediate calculations. round your answers to the nearest whole dollar amount.)1. record the current-year tax levies to be collected by the agency.2. record the current taxes collected during the first half of 2017.3. record the liabilities due to all funds and governments at the end of first half-year.4. record the distribution of all cash in the tax agency fundb. prepare journal entries for each of the foregoing entries that affected the town of bayshore general fund. begin with the tax levy entry, assuming 2 percent of the gross levy will be uncollectible. (if no entry is required for a transaction/event, select "no journal entry required" in the first account field. do not round intermediate calculations. round your answers to the nearest whole dollar amount.)1. record the revenues receivable and uncollectible.2. record the taxes collected whats the answer to 22= b/2 -2 A brief conversation with an artist at a gallery is best because1.the artist needs to talk to many other people2.most artists do not like talking about their work3.many artists want to avoid discussions with students4.it is unusual for an artist to make an appearance in public Molly is painting a model house and needs to know how much paint she will need. She knows the surface area of the prism is 216 square inches and the surface area of the pyramid is 84 square inches.1. Which surface is shared by the two solids? What are the dimensions of this surface?2. There is another surface that Molly does not need to paint, because it wont show when she displays the model house. Describe that surface, and explain why it doesn't need to be painted.3. To find the area Molly needs to paint, she should add the surface areas of both solids and subtract:twice the area of the triangletwice the area of the squarethree times the area of the squarethe area of the square4. Find the area Molly needs to paint. Show your work, and be sure to include units with your answer.Oh and here's an image to help you out ? QuestionPart AIn this task, you will combine what you found for unemployment data in Task 1 with what you learned inthe tutorial about Production Possibility Curves to create a PPC. On the graph below, sketch ahypothetical Production Possibility Curve. Use your interpretation of the current unemployment data toplace a point on the graph that represents where the US economy might currently be in terms of itsoutput of goods and services [For instance, you may ask: How might the country be allocating itsresources (to produce the goods referenced on the graph axes)? And: Is it operating within, on, oroutside of its PPC?]. answer the questions. 17. Suppose you attach the object with mass m to a vertical spring originally at rest, and let it bounce up and down. You release the object from rest at the springs original rest length. (a) Show that the spring exerts an upward force of 2.00mg on the object at its lowest point. (b) If the spring has a force constant of 10.0N/m and a 0.25-kg-mass object is set in motion as described, find the amplitude of the oscillations. (c) Find the maximum velocity.Please show all of your work. Can you help me? i need help! 1. When you are writing, it is preferredthat you useas much aspossible.O active voiceO passive voiceO balanced voiceO detached voice2. Identify the sentence written withpassive voice.O My brother gave me a hug.O The ballots were collected.O A stray dog chased the cat.O I cooked a steak for lunch.3. Identify the sentence written withactive voiceOlate lunch near the river.O A ladybug was released outside.O The deer was seen by the campers.My ring was cleaned by thejeweler. It has taken you 10 minutes to go 75 kilometers, How fast are you moving?(And please do not respond with suspicious links :) A line passes through ( 8,6) and ( 2, 3).Find the y-intercept, b, of the line. On Tuesday, Karen finished all her chores in 3/4 of an hour. On Wednesday, she finished her chores in 5/12 of an hour. How much faster was Karen on Wednesday than Tuesday? Does 3(7x +7) + 5x represent a number that is greater than, less than, or equal to 5(5x + 10)