New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer sciences
operating system
A Balanced Introduction to Computer Science 3rd edition David Reed - Solutions
What do you think would happen if you forgot to place a HALT instruction at the end of a machine-language program? How would the Control Unit react? Use the simulator to test your prediction, then report the results.
What sequence of assembly-language instructions corresponds to the machine language instruction set from Exercise 14.7?
What sequence of assembly-language instructions corresponds to the machine language instruction set you wrote in Exercise 14.9? Refer to Exercise 14.9, What sequence of machine-language instructions would cause the simulator to add the contents of memory locations 10, 11, and 12 and then store the
Write a sequence of assembly-language instructions that multiplies the contents of memory location 10 by four. For example, if the number 10 were stored in memory location 10, executing your instructions would cause the simulator to store 40 there. Note: although the ALU Operation knob does not
Describe the settings that would cause the value stored in R2 to be doubled?
How many cycles are required to add the contents of R0, R1, and R2 and then place the sum in R3? Describe the settings for each cycle.
What settings would result in the sum of registers R0 and R3 being stored in memory location 4?
What settings would cause the contents of memory address 4 to be copied into register R0?
Assuming that data can be copied to and from main memory in a single CPU cycle, how many cycles are required to add the contents of memory addresses 5 and 6 and then store the result in memory address 7? Describe the settings for each cycle.
What task would the following machine-language program perform? 0: 1010001000000000 1: 1000001000000011 2: 1111111111111111
What sequence of machine-language instructions would cause the contents of the four registers to be copied into memory locations 7, 8, 9, and 10, respectively?
What sequence of machine-language instructions would cause the simulator to add the contents of memory locations 10, 11, and 12 and then store the result in memory location 13?
Machine languages are machine-specific, meaning that each type of computer has its own machine language? Explain why this is the case.
Within the control unit, what is the role of the program counter (PC)? That is, how is the PC used in fetching and executing instructions?
In a stored-program computer, both instructions and data are stored in main memory. How does the Control Unit know where the program instructions begin? How does it know where the instructions end?
Describe two advantages of assembly languages over machine languages?
Enter the strdemo.html text from Figure 15.2 into a new Web page, then load this page to verify that it behaves as described.After experimenting with strdemo.html, augment the page so that a lowercase version of the string is also displayed in the page division?
Consider the following code segment, which removes all spaces and punctuation marks from a given phrase. The first statement performs a search to determine whether the phrase contains a space or punctuation mark. If such a character is found, then its index will be stored in the variable index and
Design and implement a Web page named pal.html that tests whether a word or phrase is a palindrome. Your page should allow the user to enter a word or phrase and then display a string indicating whether that word or phrase is a palindrome. The code that evaluates the user's input should be case
Add the above two assignment statements to your cipher.html page so that it properly encodes messages containing both uppercase and lowercase letters. As before, any non-letters (including spaces and punctuation marks) should be left unchanged by the encoding?
Augment your cipher.html page so that it can both encode and decode messages. You will need to define a new function named Decode, which decodes the message in the text area using the entered cipher key. You should also add a second button labeled "Decode the message" that calls this new function
Consider a variation on the code in Figure 15.5, in which the string concatenation inside the while loop is reversed:str = foobar; i = str.search(/[aeiou]/); while (i != -1) {str = str.substring(0, i) + '*' + str.substring(i+1, str.length); i = str.search(/[aeiou]/);}
Design and create a Web page named phoney.html that converts alphabetic phone numbers into entirely numeric ones. Your page should allow the user to enter the number (possibly containing letters) in a text box. When the user clicks a button, the page should call a function to translate the input,
Design and create a Web page named roman.html containing a text box in which the user can enter an ancient Roman numeral. When the user clicks a button, the number represented by that Roman numeral should appear in the page.Once you have completed your page, use it to convert the following Roman
Add elements to your roman.html page so that the user can perform the opposite conversion, translating a number into an ancient Roman numeral.[One approach to building the Roman numeral would be to write a series of while loops. As long as the number entered by the user is greater than or equal to
A more challenging programming exercise would be to modify your roman.html page so that it uses the modern style of Roman numerals. In this system, I can appear before V and X to represent 4 and 9, respectively; X can appear before L and C to represent 40 and 90, respectively; and C can appear
Modify your cipher.html page from Exercise 15.15 so that it implements a rotating substitution cipher.[This should require only minimal changes to the code. After each character in the message has been encoded/decoded, your Rotate function (from Exercise 15.4) should be called to rotate the key.]
Whenever you order a pizza, you are faced with the dilemma of which size to order. Is a large pizza a good deal, or would you be better off ordering two mediums?Create a Web page named pizza.html that determines the cost per square inch of any pizza.The page should contain text boxes in which the
Create a text file named string.js and enter the Capitalize function into that file. Then, modify your strdemo.html page so that it loads this library file. When the button in the page is clicked, in addition to displaying the previous values, it should also call the Capitalize function and display
Define a function named Rotate that takes a string as input and returns a copy of that string in which all characters are rotated one position to the left. This means that the second character should be shifted from index 1 to index 0, the third character should be shifted from index 2 to index 1,
Define a function named Classify that takes a string as input and then determines whether the string is a single word (containing no spaces) or a phrase (containing one or more spaces). The function should return a string value, either 'word' or 'phrase', depending on whether the input string
Define a function named PigLatin that takes a string as input and returns the Pig Latin translation. For example, the call PigLatin('oops') should return 'oopsway', whereas PigLatin('foo') should return 'oofay'. Insert this function definition into your string.js library file. Then, create a Web
Technically speaking, the Pig Latin rules that we have established apply only to words, not phrases. However, your current piglatin.html page does nothing to prevent users from entering a string containing spaces. Thus, a user could enter 'foo bar' in the text box and be told that the Pig Latin
Define a function named Reverse that takes a string as input and returns a copy of that string in reverse order. For example, the function call Reverse('abcd') should return the string 'dcba'. Once you have developed this function, insert its definition into your string.js library file. Then,
1. TRUE or FALSE? Nonmetals such as carbon and oxygen tend to be good conductors of electricity. 2. TRUE or FALSE? A semiconductor is a metal that can be manipulated to be either a good or a bad conductor of electricity. 3. TRUE or FALSE? A circuit is a collection of transistors (and possibly other
Name three different technologies that, over the years, have served as electrical switches in computers. How were these technologies similar, and how were they different? What advantages or disadvantages did each provide?
Electricians commonly wear rubber shoes and gloves to protect themselves when working with live wiring. Would this suggest that rubber is an efficient or inefficient conductor of electricity? Explain your answer.
Describe the difference between an NMOS transistor and a PMOS transistor?
It is possible to develop truth tables for logic circuits, just as we did for individual gates. For example, the following logic circuit combines an AND gate and an OR gate. Complete the corresponding truth table by calculating the output value for each set of inputs. [Figure out the output of the
The following logic circuit is similar to the one in Question 4, except that the AND and OR gates are in reversed positions. Complete the corresponding truth table by calculating the output value for each set of inputs?
What is the sum of the binary numbers 1001012 and 10112? Show the steps you used to calculate your answer.
Explain why the circuitry for adding two 4-bit numbers must be constructed by combining full adders, rather than half-adders?
What is the total number of gates required to build a 4-bit adder? Assuming two transistors per NOT gate (as in Figure 16.8) and four transistors per AND and OR gate (as in Figures 16.9 and 16.10, respectively), what is the total number of transistors in the circuitry of the 4-bit adder?
Describe how a flip-flop is able to retain the last bit value assigned to it?
Does it make any sense for both of a flip-flop's input wires to carry current at the same time? What would happen within the circuit if this were to happen?
In what way is integrated-circuit manufacturing similar to photography?
Can Moore's Law continue to hold forever? That is, can technology continue to advance at its current rate indefinitely, causing the number of transistors that fit on a microchip to double every 12 to 18 months? Explain.
Assume that the following statements have assigned arrays to variables:responses = ['yes', 'no', 'maybe'];nums = [1, 2, 3, 2+1, 7*7, 2*5-1];misc = [1.234, 'foo', 7-5, true, 3, 'foo'];empty = [ ];Predict the value that would be accessed by each of the following expressions:
Augment your stats.html page so that, in addition to displaying the counts for each dice total, the page also represents the counts as percentages of the total number of rolls. To compute each percentage, you must divide the count by the total number of rolls, then multiply by 100. For example, if
Using your stats.html page, perform 100 dice rolls and report the results. Are your percentages close to the expected ones listed in Figure 17.14? Should they be? Now, perform 1,000 dice rolls using your page and report the results. Are the percentages from this experiment closer to the expected
Define a function named Minimum that is similar to the Average function from Figure 17.11, but that takes an array of numbers as input and returns the smallest value from that array. For example, the call Minimum ([33, 12, 5, 17, 8]) should return 5. After inserting this function into your
When a course has numerous assignments, a kindly instructor may drop a student's lowest grade to allow for one bad day. Modify your grades.html page from Exercise 17.8 so that the lowest lesson grade is ignored.[To compute the average of a collection of grades while dropping the lowest grade, you
Modify your stats.html page so that it simulates repeatedly rolling a pair of eight-sided dice and then collects statistics on the dice totals obtained. Because the array of counters provides extreme flexibility, only minimal changes should be required to adapt the page?
Add the SeqSearch function to the arrays.js library file, then create a Web page named seq.html that utilizes the SeqSearch function to perform sequential searches on user input. The page should contain a text area in which the user can enter a sequence of words separated by white space, as well as
After experimenting with seq.html's sequential search capabilities, answer the following questions: • What is the minimum number of inspections required to find an item in an array using sequential search? Where must the desired item occur in the array in order for the page to perform this
Using the array of names from the previous examples (repeated below), perform the following traces: name = ['Charlie','Dave','Jack','Jerald','Jerroll','Laura','Lois','Winnie'];
The sort method, when applied to an array of strings, returns a copy of that array in which the strings appear in alphabetical order. For example, if the variable words stored the array ['foo', 'bar', 'biz'], then the call words.sort() would return ['bar', 'biz', 'foo'].Define a function named
Suppose that the assignment to random-Index in the Random-One-Of function (Figure 17.2) were replaced by the following: randomIndex = RandomInt(0, list.length); Would this modification cause the function to return an error? Would the function still behave appropriately every time it is called?
After experimenting with bin.html's binary search capabilities, answer the following questions: • What is the minimum number of inspections required to find an item in an array using binary search? Where must the desired item occur in the array in order for the page to perform this minimum number
Design and create a Web page named states.html that quizzes the user on state capitals. The layout of the page is entirely up to you. However, the page should contain a text box in which the user can specify the number of questions on the quiz. After processing this input, the page should
Modify your states.html page so that it uses the nested array structure STATE_INFO to store the names of the states and their capitals. Then, experiment with the new version to verify that the page behaves as before?
For each of the following statements, draw the memory cell associated with the variable after the assignment has been made:
The first statement that follows assigns a string to variable people, whereas the subsequent four assignments split people into various arrays. For each of these statements, draw the memory cell associated with the variable after the assignment has been made:
Create a Web page named acronym.html that derives an acronym from a given phrase. The page should load the arrays.js library file (accessible at balance3e.com/arrays.js) and contain a text box in which the user can enter the phrase. When the user clicks the button in the page, the Acronym function
Modify your PigLatin function (Exercise 15.7) so that it can translate entire phrases of words into Pig Latin. Similar to the Acronym function from Exercise 17.5, your function should break the input string into words using the split method. It should then translate each word as before and combine
Enter the average.html text from Figure 17.12 into a new Web page, then load this page to verify that it behaves as described. What happens if you click on the button without entering any numbers in the text box?Calling the split method on an empty string produces an empty array, i.e., an array
Re-implement your grades.html page from Chapter 7 (Exercise 7.4). Instead of requiring users to provide pre-computed averages, your modified page should provide text boxes in which users can enter a series of grades for each category (e.g., all homework grades obtained by the user could be listed
Design and create a Web page named stats.html that simulates a number of dice rolls and displays statistics on those rolls. The user should be able to specify the number of dice rolls via a text box and then click a button to view the resulting counts. Figure 17.17 portrays one possible layout for
1. TRUE or FALSE? Computer technology has greatly impacted the banking industry, to the extent that credit cards and debit cards have reduced consumers' reliance on cash. 2. TRUE or FALSE? Embedded processors are computer chips that are built into appliances and machinery to control their
Describe two advantages of online newspapers over their print counterparts. Do you think that electronic newspapers will completely replace printed papers in the near future? Why or why not?
Utilize a search engine to research and answer the following questions. Identify the site at which you obtained your answer, as well as the search parameters you used to locate the page. • Who invented the programming language PHP? • In what year did the Battle of Hastings take place? • Who
Showing 1100 - 1200
of 1171
1
2
3
4
5
6
7
8
9
10
11
12
Step by Step Answers