subject

Assume we have a "computing agent" that knows how to do one-digit subtraction where the first digit is at least as large as the second(i. e, we do not end up with a negative number). Thus, our computing agent can do such operations as 7-3=4, 9-1=8, and 5-5=0. It can also subtract a one- digit value from a two-digit value in the range 10-18 as long as the final result has only a single digit. This capability enables it to do such operations as 13-7=6, 10-2=8 and 18-9=9.Using these primitive capabilities, disign an algorithm to do decimal subtraction on two m-digit numbers, where m Image for Assume we have a computing agent that knows how to do one-digit subtraction where the first digit is at least 1.You will be given two unsigned whole numbers am-1 am-2 a0 and bm-1 bm-2 b0. Your algorithm must compute the value cm-1 cm-2 c0, the difference of these two values. (am-1 am-2 a0 )-(bm-1 bm-2 b0 ) = cm-1 cm-2 c0 You may assume that the top number ( am-1 am-2 a0 ) is greater than or equal to the bottom number (bm-1 bm-2 b0 ) so that the result is not a negative value. However, do not assume that each individual digit ai is greater than or equal to bi. If the digit on the bottom is larger than the digit on the top, then you must implement a borrowing scheme to allow the subtraction to continue. (Caution: it may have been easy to learn subtraction as a first grader, but it is devilishly difficult to tell a computer how to do it!)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:10
3. bob is arguing that if you use output feedback (ofb) mode twice in a row to encrypt a long message, m, using the same key each time, it will be more secure. explain why bob is wrong, no matter what encryption algorithm he is using for block encryption (15 points).
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
question
Computers and Technology, 24.06.2019 10:20
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Which one of the following functions is not available on the autosum tool? sum average if max
Answers: 3
You know the right answer?
Assume we have a "computing agent" that knows how to do one-digit subtraction where the first digit...
Questions
question
Biology, 10.05.2021 18:20
question
Social Studies, 10.05.2021 18:20
question
Mathematics, 10.05.2021 18:20
Questions on the website: 13722367