Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
1. Your first task will be to come up with an appropriate data structure for representing numbers of arbitrary potential length in base 215. You will have to deal with large negative numbers also1. (Any negative number is to be stored in such a way that the most significant digit is a -1, but all lower order digits are positive. Note that you will need to make sure that you don't have a multidigit number with 0 as the high order digit. Also, you are required to make sure that the top two high order digits of any number store are not -1,32767. If you have trouble figuring out why, come see me...) You need to write a function that takes a given file that contains a number in base 10, reads it in, and stores it in your data structure in base 215.2. Given a number that is represented in your data structure, you will need a function that prints it out in base 215 in such a way that its contents can be checked for correctness. Your function will need to print out the "digits" of the number, one digit after another, each separated by a comma with no white spaces in between, high-order "digit" of your number first.3. You will write functions for both addition and subtraction of two num- bers encoded in your data structure. These functions should not be hard to write. Remember how you add and subtract numbers in base 10 and you should be able to figure out how to do it. Addition should automati- cally calculate the sum of memory locations 1 and 2 and store the answer in memory location 3 (erasing any other number that was previously in memory location 3). Subtraction should automatically calculate mem- ory location 1 minus memory location 2 and store the answer in memory location 3 (again, erasing any previous data).4. You need to write a function that performs multiplication of two numbers in your data structure. Again, remember how you multiply numbers in base 10 and you should be fine. Multiplication should automatically cal- culate the product of memory locations 1 and 2 and store the answer in memory location 3 (erasing previous data).5. Write a function that performs integer division. The function should take the large number in memory location 1 and divide it by the large number in memory location 2 disregarding any remainder. The result should be placed into memory location 3. This will probably be your most difficult function to write for this assignment. Remember how you do long division in base 10...6. Write a function that performs the integer mod function. Given the pre- vious functions you have implemented already, this one should be a piece of cake. This function will find the result of taking the large number in memory location 1 modulo the large number is memory location 2, placing the result in memory location 3. (If location #2 has a negative number in it, then you will take the mod using the absolute value of that number.) The result of a "mod" operation will always be a nonnegative number less than absolute value of the large number in memory location 2.7. Finally, you need to implement a function which will write out a given user-specified memory location to disk in base 10. That means that you have to convert the large number data structure back into base 10 digits before writing them back out to disk. The user will input the file name that the file is supposed to write to along with which memory location.Your program should be menu driven and contain menu functions for each of the functions that you had to write above. Your code doesn't need to be superoptimized, but it does need to be good enough so that any given command takes at most one minute to execute. The menu should look as follows.1. Read in a number from a file 2. Print out a large number to the screen 3. Add two large numbers 4. Subtract two large numbers 5. Multiply two large numbers 6. Integer divide two large numbers 7. Location 1 modulo location 2 8. Write to disk in base 10 9. Quit Choose your option: 1 File name: a.dat Memory location (number between 1 and 3): 1
identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:
Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..
Assignment : Cores on Computer Systems: Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.
Prepare working solutions in Excel that will manage the annual budget
Research paper in relation to a Software Design related topic
Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.
Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)
Evaluate the cost of materials
Depending on how comfortable you are with using the MARIE simulator after reading
What is the main advantage of using master pages. Explain the purpose and advantage of using styles.
Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems
Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd