Use Windows to rename the Colors Solution folder to Colors Solution-Modified. Open the Colors Solution.sln file contained in the VB2017\Chap01\Colors Solution-Modified folder. If necessary, open the...
Write an inheritance hierarchy that stores data about sports players. Create a common superclass and/or interface to store information common to any player regardless of sport, such as name, number,...
Write a program that processes a data file of students course grade data. The data arrive in random order; each line stores information about a students last name, first name, student ID number,...
Revise GraphView in Listing 28.6 to display a weighted graph and a minimum spanning tree for the graph in Figure 29.1, as shown in Figure 29.26. The edges in the MST are shown in red. Listing Seattle...
Write the C++ code to compare the contents of two int variables named code1 and code2. If both variables contain the same value, display the Equal message; otherwise, display the Not equal message.
Write a short Java method, isMultiple, that takes two long values, n and m, and returns true if and only if n is a multiple of m, that is, n = mi for some integer i.
In this exercise, you modify the Gross Pay application from this chapters Focus lesson. Use Windows to make a copy of the Gross Solution folder. Rename the copy Modified Gross Solution. Open the...
Consider the following pseudocode: 1. procedure main() 2. a : integer := 1 3. b : integer := 2 4. procedure middle() 5. b : integer := a 6. procedure inner() 7. print a, b 8. a : integer := 3 9. ...
Write a method public static String middle(String str) that returns a string containing the middle character in str if the length of str is odd, or the two middle characters if the length is even....
Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations20s, 10s, 5s, and 1s. Save the program as Dollars.java.
Modify the Card class so the setValue() method does not allow a Cards value to be less than 1 or higher than 13. If the argument to setValue() is out of range, assign 1 to the Cards value. You also...
Write a Java program that serves as a primitive web browser. For this assignment it merely needs to input a server name and display the HTML that is sent by the web server. A web server normally...
Write a static method blur(double[][]picture) that you could use on a part of a picture file to obscure a detail such as a persons face or a license plate number. This method computes the weighted...
Modify Exercise 10, adding an interface called SidedObject that contains a method called displaySides(); this method displays the number of sides the object possesses. Modify the GeometricFigure...
Design a program that computes pay for employees. Allow a user to continuously input employees names until an appropriate sentinel value is entered. Also input each employees hourly wage and hours...
a. You created an application named DrugTests that produces a list of randomly selected employees who will be tested each week for the next 52 weeks. Now modify the program to include a count and...
Sketch a reasonably simple combinational circuit implementing each of the functions from Exercise 2.6.
What does the following program do? // Exercise ANS: : SomeClass.java public class SomeClass { public static String someMethod(int[] array2, int x) if (x < array2.length) { return String.format(...
a. Write an application that extends JPanel and displays a phrase in a large font. Each time the user clicks a JButton, display the same phrase in a different color, a little further to the right,...
Section 22.10.2 introduced Graham?s algorithm for finding a convex hull for a set of points. Assume that the Java?s coordinate system is used for the points. Implement the algorithm using the...
In the text, we say that after the merge sort splits the array into two subarrays, it then sorts these two subarrays and merges them. Why might someone be puzzled by our statement that it then sorts...
Write a Boolean equation in product-of-sums canonical form for the truth tables in Figure 2.81. (a) (b) (c) (d) (e) A 1 O HOH O HOH
Write a method called coinFlip that accepts a Scanner representing an input file of coin flips that are heads (H) or tails (T). Consider each line to be a separate set of coin flips and output the...
A file named MAINTENANCE09-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in...
Draw a diagram to show the use of a proxy server that is part of the client network: a. Show the transactions between the client, proxy server, and the target server when the response is stored in...
A very common problem in computer graphics is to approximate a complex shape with a bounding box. For a set, S, of n points in 2-dimensional space, the idea is to find the smallest rectangle, R, with...
If necessary, create a new project named Intermediate22 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Intermediate22.cpp. If you are using Microsoft Visual C++,...
Mills Skating Rink holds a weekly ice-skating competition. Competing skaters must perform a two-minute program in front of a panel of judges. The number of judges varies from week to week. At the end...
The inorder method in Tree24 is left as an exercise. Implement it.
Refer to the complete RMO CSMS domain model class diagram shown in Figure 4-25. Based on that model and on the discussion of subsystems in Chapter 3, draw a domain model class diagram for the CSMS...
A self-organizing list is a linked list of n elements, in which each element has a unique key. When we search for an element in the list, we are given a key, and we want to find an element with that...
Consider an ad hoc network in which communication (message or packet transfer) is to take place from node X to node Y. The route has already been established, and a data packet is to be transferred...
In the text, we identify four different addresses that are normally used during the passage of a message from source to destination using TCP/IP and Ethernet. These include a user-friendly address, a...
Write a JSF page that displays a factorial page as shown in Figure 33.25. Display the table in an h:outputText component. Set its escape property to false to display it as HTML contents. Factoriaks -...
Use the fact database and patron collection created in the text for use with MongoDB. Modify the document entered in the previous question with the following data. Do not replace the current...
a. You modified a previously created Card class so that each Card would hold the name of a suit (Spades, Hearts, Diamonds, or Clubs) as well as a value (Ace, King, Queen, Jack, or a number value)....
Write an application that allows a user to select a country from a list box that contains at least seven options. After the user makes a selection, display the countrys capital city. Save the file as...
What characteristics do a CASE tool and a DBMS have in common? How can these characteristics be used to enhance the data administration?
Define a new class named UnweightedGraphWithGetPath that extends UnweightedGraph with a new method for finding a path between two vertices with the following header: public List getPath(int u, int...
How would you modify the Little Man Computer to implement the pipe lined instruction fetchexecution unit model that was described in this chapter? What would it take to supply multiple execution...
In this exercise, you create an application for Genatone Inc. The application displays the price of an order based on the number of units ordered and the customers status (either wholesaler or...
Write a program to animate push and pop in a stack, as shown in Figure 24.20a. Stack Arimation C wStackhtmi Q www.cs.amstrong.edu/liang/arimatian/web/S 67 34 31 45 43 24 Enter a value: 67 Push Pop...
Complete the following tasks: Design a method that calculates the monthly cost to rent a roadside billboard. Variables include the size of the billboard ( S , M , or L, for small, medium, or large)...
Give an O(n lg k)-time algorithm to merge k sorted lists into one sorted list, where n is the total number of elements in all the input lists. Use a min heap for k-way merging.
In Section 9.2 we discussed adding functionality for dividend payments to the Stock class. Why was it preferable to create a DividendStock class rather than editing the Stock class and adding this...
In this exercise, you code an application that displays a grade based on the number of points entered by the user. The grading scale is shown in Figure 9-43. Open the VB2015\Chap09\Chang...
The smoothness of a period deter-mines the way the magnitude line spectrum decays. Consider the following periodic signals x(t) and y(t) both of fundamental period T 0 = 2sec., and with a period from...
Enter sample data of your own choosing into QtyOnHand in the Product_T table. Test the modification you made in Problem and Exercise 16 by attempting to update a product by changing the inventory to...
Open the Opals Solution.sln file contained in the VB2017\Chap12\Opals Solution folder. The application is already connected to the Opals.mdf file, and the OpalsDataSet has already been created. The...
you have created a number of programs for Sammys Seashore Rentals. Now, create an interactive GUI program that allows the user to enter a rental time in hours into a text field; if the value entered...
Carlos receives 24 paychecks each year. Each paycheck, he contributes a specific percentage of his gross pay to his retirement plan at work. His employer also contributes to his retirement plan, but...
Define the following methods for the class Ledger, as described in the previous exercise: getAverageSale()returns the average value of all the sales getCountAbove(v)returns the number of sales that...
Pick an OOP language with which you are familiar. Find a programming IDE tool that supports that language. Test its reverse-engineering capabilities to generate UML class diagrams from existing code....
Suppose you are building a first-person shooter game, where virtual zombies are climbing up a wall while the player, who is moving left and right in front of the wall, is trying to knock them down...
Given the ArrayList from problem 4, write a for-each loop that prints the uppercase version of each String in the list on its own line. Data from Problem 4 Write code to insert two additional...
Redraw Figure 23.19 with 5 packets exchanged (0, 1, 2, 3, 4). Assume packet 2 is lost and packet 3 arrives after packet 4.
You created a Die class from which you could instantiate an object containing a random value from 1 through 6. You also wrote an application that randomly throws two dice and displays their values....
Using your schema from Question 10, write an FLWOR XQuery expression that lists only the tutors names and lists them alphabetically by last name.
a. You created an interactive StaffDinnerEvent class that obtains all the data for a dinner event for Carlys Catering, including details about the event and all the staff members required to work at...
Write an HDL module for the circuit in Exercise 3.31. Data from problem 3.31 Analyze the FSM shown in Figure 3.72. Write the state transition and output tables and sketch the state transition...
The StringBuilder class is provided in the Java library. Provide your own implementation for the following methods (name the new class MyStringBuilder2): public MyStringBuilder2(); public...
In this exercise, you modify the Password application from this chapters Apply lesson. Use Windows to make a copy of the Password Solution folder. Rename the copy Modified Password Solution. Open the...
You modified the EventDemo program for Carlys Catering to accept and display data for an array of three Event objects. Now, modify the program to use an array of eight Event objects. Prompt the user...
Sketch a circuit for the function from Exercise 2.31.
Modify the HTML form for the election and the servlet VoteCounter to allow voters to vote for one additional office. The new office is named catcatcher. Candidates for catcatcher are Kitty Catland,...
a. How many wires are there in Ethernet cable? 6a1.) What type of copper wiring is widely used in Ethernet? a. Optical fiber b. 4-pair UTP c. Both A and B d. Neither A nor B 6a2.) How many wires are...
The CPU scheduling algorithm (in UNIX) is a simple priority algorithm. The priority for a process is computed as the ratio of the CPU time actually used by the process to the real time that has...
A finite Turing machine has a finite one-dimensional tape of cells, each cell containing one of a finite number of symbols. One cell has a read and write head above it. There is a finite set of...
You have created a number of programs for Carlys Catering. Now, create an interactive GUI program that allows the user to enter the number of guests for an event into a text field; if the value...
Let S be a finite set and let S 1 , S 2 , . . . ,S k be a partition of S into nonempty disjoint subsets. Define the structure (S, I) by the condition that I = {A : |A S i | 1 for i = 1, 2, . . ....
Show that if G is a CFG in Chomsky normal form, then for any string w L(G) of length n 1, exactly 2n 1 steps are required for any derivation of w.
Create an application that accepts employee data interactively. Users might make any of the following errors as they enter data: The employee number is not numeric, less than 1000, or more than 9999....
Alice has three array-based stacks, A, B, and C, such that A has capacity 100, B has capacity 5, and C has capacity 3. Initially, A is full, and B and C are empty. Unfortunately, the person who...
Verify the conceptual model you created in Appendix B, Problem 4. Create a data dictionary for the verified model.
What is the fundamental difference between the Ricochet solution and IEEE 802.16?
Write a program that enables the user to specify the location and size of the circles and displays whether the two circles intersect, as shown in Figure 16.39a. Enable the user to point the mouse...
When attenuation occurs in an analog signal, what hardware device is used to restore the original signal? When attenuation occurs in a digital signal, what hardware device is used to restore the...
Write a method called printDuplicates that takes as a parameter a Scanner containing a series of lines. Your method should examine each line looking for consecutive occurrences of the same token on...
Design a class named Date that meets the following requirements: Three data fields year, month, and day for representing a date A constructor that constructs a date with the specified year, month,...
To access data from a typical DRAM, we first have to activate the appropriate row. Assume that this brings an entire page of size 8 KB to the row buffer. Then we select a particular column from the...
You created a class called RandomGuess. In this game, the application generates a random number for a player to guess. Improved the application to display a message indicating whether the players...
You created an interactive StaffDinnerEvent class that obtains all the data for a dinner event for Carlys Catering, including details about the staff members required to work at the event. Now,...
Define a one-to-many relationship.
In this chapter you learned the basics of classes. Now youll begin fleshing out aspects of a class called Hybrid Vehicle. Hybrid vehicles are becoming increasingly popular, because they often get...
a. In Chapter 10, you developed a Card class that contains a string data field to hold a suit and an integer data field for a value from 1 to 13. Now extend the class to create a class called...
Write a method called firstLast that can accept either type of integer list as a parameter and that moves the first element of the list to the end. For example, if a variable called list contains the...
Give a description, in pseudocode, for implementing the retainAll method for the set ADT, using only the other fundamental methods of the set.
Suppose the method quickSortInPlace is executed on a sequence with duplicate elements. Prove that the algorithm still correctly sorts the input sequence. What happens in the partition step when there...
Suppose you are working for a victim-support group to build a website for maintaining a set, S, containing the names of all the registered sex offenders in a given area. The system should be able to...
Add an iterator to the HashSet class written in this chapter. To do this you will need to write an inner class that can iterate over the elements of the set, remembering its position as it moves...
Describe a program for which you would use the ArrayList class instead of arrays to implement choices. Describe a program for which you would use arrays instead of the ArrayList class. Explain your...
Write a program that accepts a number of quarts from a user and converts the value to gallons. Include exception-handling capabilities in the program so that while any nonnumeric value is entered,...
Open the VB2015\Chap08\Jacobson Solution\Jacobson Solution (Jacobson Solution.sln) file. The interface provides a text box for entering a password. The password can contain five, six, or seven...
If a user wants to enter two numbers, what must the Little Man program do before she enters the second number? Why?
You created a game named Quiz in which the user could respond to multiple-choice questions. Modify the game so that it stores the players highest score from any previous game in a file and displays...
Consider the following decimal numbers: 245 and 0.0625. (a) Write the two numbers using single-precision floating-point notation. Give your answers in hexadecimal. (b) Perform a magnitude comparison...
Create animation in Figure 16.46b to meet the following requirements: Allow the user to specify the animation speed in a text field. Get the number of iamges and images file-name prefix from the...
Use polygons and lines to create a graphics image that looks like a fireworks display. Write an application that extends JPanel and displays the fireworks. Save the file as JFireworksPanel.java.
The tblMagazine table contains three fields. The Cost field is numeric. The Code and MagName fields contain text. a. Write a SQL SELECT statement that arranges the records in descending order by the...
Refer to the case information provided at the end of Chapters 10 and 11 and the domain class diagram at the end of Chapter 9. Review and update your results from performing the tasks at the end of...