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 22:40
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
[java] create an application called registrar that has the following classes: a. a student class that minimally stores the following data fields for a student: - name - student id number - number of credits - total grade points earned and this class should also be provides the following methods: - a constructor that initializes the name and id fields - a method that returns the student name field - a method that returns the student id field - methods to set and retrieve the total number of credits - methods to set and retrieve the total number of grade points earned. - a method that returns the gpa (grade points divided by credits) b. an instructor class that minimally stores the following data fields for an instructor: - name - faculty id number - department the following methods should be provided: - a constructor that initializes the name and id fields - methods to set and retrieve the instructor’s department. c. a course class that minimally stores the following data for a course: - name of the course- course registration code- maximum number of 35 students- instructor- number of students- students registered in the course (an array)the following methods should also be provided: - a constructor that initializes the name, registration code, and maximum number of students- methods to set and retrieve the instructor- a method to search for a student in the course; the search should be based on an id number.- a method to add a student to the course. if the course is hill, then an exception with an appropriate message should be raised (try creating your own exception class for this). also, be sure that the student is not already registered in the course. the list of students should be in the order that they registered.- a method to remove a student from the course. if the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned a method that will allow course objects to be output to a file using object serialization- a method that will allow course objects to be read in from a file created with object serializationyou will note that the student and instructor classes described above have some commonality. create aperson class that captures this commonality and uses it as a base class for student and instructor. this class should be responsible for the name and id fields and also provide atostring method that returns a string of the form name, id. this will be the inheritedtostring method for the student and instructor classes.1. draw a uml diagram for diss application.2. implement the previous classes in java. write a main program that can serve as a test class that tests all of the methods created and demonstrates that they are working
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 23.06.2019 22:20
If i uninstall nba 2k 19 from my ps4 will my career be gone forever?
Answers: 2
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
Mathematics, 12.12.2020 16:40
question
Mathematics, 12.12.2020 16:40
question
Computers and Technology, 12.12.2020 16:40
question
Mathematics, 12.12.2020 16:40
question
Mathematics, 12.12.2020 16:40
Questions on the website: 13722359