subject

Convert to binary - functions 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 your program must define and call the following two functions. the integertoreversebinary function should return a string of 1's and 0's representing the integer in binary (in reverse). the reversestring function should return a string representing the input string in reverse. string integertoreversebinary(int integervalue) string reversestring(string userstring) note: this is a lab from a previous chapter that now requires the use of a function.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
When writing a business letter, how many times can you use the same merge field in a document? once once, unless using the address block feature unlimited it will depend on the type of document you choose
Answers: 1
question
Computers and Technology, 24.06.2019 18:30
*write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard).
Answers: 1
You know the right answer?
Convert to binary - functions write a program that takes in a positive integer as input, and outputs...
Questions
question
Mathematics, 24.11.2019 18:31