2.99 See Answer

Question: The Rochester Bank maintains customer records in


The Rochester Bank maintains customer records in a random access file. Write an application that creates 10,000 blank records and then allows the user to enter customer account information, including an account number that is 9998 or less, a last name, and a balance. Insert each new record into a data file at a location that is equal to the account number. Assume that the user will not enter invalid account numbers. Force each name to eight characters, padding it with spaces or truncating it if necessary. Also assume that the user will not enter a bank balance greater than 99,000.00. Save the file as CreateBankFile.java.
b. Create an application that uses the file created by the user in Exercise 8a and displays all existing accounts in account-number order. Save the file as ReadBankAccountsSequentially.java.
c. Create an application that uses the file created by the user in Exercise 8a and allows the user to enter an account number to view the account balance. Allow the user to view additional account balances until entering an application-terminating value of 9999. Save the file as ReadBankAccountsRandomly.java.


> Write an application that prompts the user for a single-digit integer and uses a loop to create the pattern shown in the example in Figure 6-32. In the example, the user entered a 3, and 10 lines are displayed; each 3 appears one additional space to the

> In previous chapters, you have created a number of programs for Yummy 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 entered is not numeric, set the event p

> Write an application that displays every perfect number from 1 through a user-supplied limit. A perfect number is one that equals the sum of all the numbers that divide evenly into it. For example, 6 is perfect because 1, 2, and 3 divide evenly into it,

> Write an application that prompts a user for two integers and displays every integer between them. Display a message if there are no integers between the entered values. Make sure the program works regardless of which entered value is larger. Save the fi

> Write an application that displays the factorial for every integer value from 1 to a user-entered limit. A factorial of a number is the product of that number multiplied by each positive integer lower than it. For example, 4 factorial is 4 * 3 * 2 * 1, o

> Write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an even number, display the message Good job! and then ask for another input. When the user types an odd number, display an error message

> Write an application that prompts a user for the number of years the user has until retirement and the amount of money the user can save annually. If the user enters 0 or a negative number for either value, reprompt the user until valid entries are made.

> Write an application that includes final constants named START and STOP that are set to 5 and 500, respectively. The application counts by five from 5 through 500 inclusive, and it starts a new line after every multiple of 50 (50, 100, 150, and so on). S

> Create a class named Purchase. Each Purchase contains an invoice number, amount of sale, and amount of sales tax. Include set methods for the invoice number and sale amount. Within the set method for the sale amount, calculate the sales tax as 5 percent

> The Huntington High School basketball team has five players named Ali, Bob, Cai, Dan, and Eli. Accept the number of points scored by each player in a game, and create a bar chart that illustrates the points scored by displaying an asterisk for each point

> Assume that the population of Mexico is 128 million and the population of the United States is 323 million. Accept two values from a user: an assumption of an annual increase in the population of Mexico and an assumption for an annual decrease in the U.S

> Use the Web to locate the lyrics to the traditional song “The Twelve Days of Christmas.” The song contains a list of gifts received for the holiday. The list is cumulative so that as each “day” passes, a new verse contains all the words of the previous v

> In previous chapters, you have created a Rental class for Sunshine Seashore Supplies. The class contains a default constructor as well as an overloaded version that requires a contract number (a letter followed by three digits), a time for the rental (in

> Create a class named Apartment that holds an apartment number, number of bedrooms, number of baths, and rent amount. Create a constructor that accepts values for each data field. Also create a get method for each field. Write an application that creates

> Create an Automobile class for a dealership. Include fields for an ID number, make, model, color, year, and miles per gallon. Include get and set methods for each field. Do not allow the ID to be negative or more than 9999; if it is, set the ID to 0. Do

> Create a class named JobApplicant that holds data about a job applicant. Include a name, a phone number, and four Boolean fields that represent whether the applicant is skilled in each of the following areas: word processing, spreadsheets, databases, and

> Acme Parts runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift, $17 per hour; second shift, $18.50 per hour; third shift, $22 per hour. Each factory worker might work any number of hours p

> Write an application that uses the LocalDate class to access the current date. Prompt a user for a month, day, and year. Display a message that specifies whether the entered date is (1) not this year, (2) in an earlier month this year, (3) in a later

> Search the Internet for information about how to use a JTextArea, its constructors, and its setText() and append() methods. Write an application that allows the user to select options for a dormitory room. Use JCheckBoxes for options such as private room

> Write an application that allows the user to choose insurance options in JCheckBoxes. Use a ButtonGroup to allow the user to select only one of two insurance types—HMO (health maintenance organization) or PPO (preferred provider organization). Use regula

> 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 country’s capital city. Save the file as JCapitals.java.

> Design an application for the Sublime Sandwich Shop. The user makes sandwich order choices from list boxes, and the application displays the price. The user can choose from three main sandwich ingredients of your choice (for example, chicken) at three di

> Write an application that allows a user to select one of at least five television shows to watch on demand. When the user selects a show, display a brief synopsis. Save the file as JTVDownload.java. b. Change the JTVDownload application to include an edi

> In previous chapters, you have created an Event class for Yummy Catering. The class contains a default constructor as well as an overloaded constructor that requires an event number (a letter followed by three digits) and a number of guests attending the

> Write an application for Lambert’s Vacation Rentals. Use separate ButtonGroups to allow a client to select one of three locations, the number of bedrooms, and whether meals are included in the rental. Assume that the locations are parkside for $600 per w

> Create an application with a JFrame and at least six labels that contain facts about your favorite topic—for example, the French Revolution or astronomy. Every time the user clicks a JButton, remove one of the labels and add a different one. Save the fil

> Write an application that instantiates a JFrame that contains a JButton. Disable the JButton after the user clicks it. Save the file as JFrameDisableButton.java. b. Modify the JFrameDisableButton program so that the JButton is not disabled until the user

> Create an application for Paula’s Portraits, a photography studio. The application allows users to compute the price of a photography session. Paula’s base price is $40 for an in-studio photo session with one person. The in-studio fee is $75 for a sessio

> Write an application that displays a JFrame containing the opening sentence or two from your favorite book. Save the file as JBookQuote.java. b. Add a button to the frame in the JBookQuote program. When the user clicks the button, display the title of th

> Write a program that prompts a user for two Strings and two integers. Send the two Strings to a generic method that sends them to another method to display, swaps their values, and then sends them to the display method again. Then send the two integers t

> Roberto has purchased buildings that contain apartments to rent. Create an Apartment class that contains fields for the street address, apartment number, monthly rent amount, and number of bedrooms for each Apartment that he owns. Include a constructor t

> Write a program that creates two ArrayLists—one to hold Strings and one to hold Integers. Prompt the user for a word, and while the user does not enter a sentinel value, continue to add each entered word to the ArrayList, sort the list, pass the list to

> Write a program that creates a String ArrayList. Continually prompt the user for Strings to add to the list until a sentinel value is entered. Use an iterator to display all the Strings, then continually ask the user for a String to eliminate until a sen

> Write a program that creates a String ArrayList. Continually prompt the user for Strings to add to the list until the user enters a sentinel value. Display the Strings in a single line separated by commas and ending with a period. Save the file as CommaP

> Sunshine Seashore Supplies rents beach equipment to tourists. In previous chapters, you developed a Rental class that holds equipment rental information, including a contract number and hours and minutes for each Rental. Now write an application that cre

> Write a program that creates an Integer ArrayList and store at least four integers in it. Use an iterator to display all the numbers. Then prompt the user for a value to remove from the list. If the number appears in the list, remove it. Display the list

> Create a Purchase class similar to the one described in a “You Do It” section earlier in this chapter. The Purchase class contains a String category for the purchase (such as groceries) and a numeric price. Include a c

> Loris Manufacturing makes 1,000 products per month and has been increasing production at a rate of 6 percent each month. Write a program that accepts a production goal from the user. If the entered goal is less than 1,000, display a message that indicate

> Assume that the current population of California is 39 million and that the population of Texas is 28 million. The population of Texas appears to be growing at a faster rate than that of California. Write an application that accepts values for the projec

> The Fibonacci sequence is the series of numbers 1, 1, 2, 3, 5, 8, 13, 21, and so on. The last number in the Fibonacci sequence is always the sum of the preceding two numbers. For example, 13 is the sum of 5 and 8, and 21 is the sum of 8 and 13. The seque

> Figure 12-27 shows two typical executions of a program that displays a large V on the screen after the user enters a height. Write a program that passes the following values to a recursive method that produces the V: the current line number, the number o

> Figure 12-26 shows two typical executions of a program that displays a triangle. Create this program by prompting the user for a number of lines to display. The first row of the output contains the number of spaces that equals the number of lines that wi

> Figure 12-20 earlier in this chapter shows the output of a program that displays any number of Os running diagonally from top left to bottom right. Now, write a program that prompts the user for a number of lines to display, and then use a recursive meth

> Write a program that creates an array of at least 20 integers and do the following: ❯ Prompt the user for a starting position, and continually reprompt the user for a new value if the starting position is less than 0 or greater than the highest allowed s

> Write a program that prompts the user for two integers. Pass them to a recursive method that returns the product of the two integers without using multiplication. In other words, instead of using the multiplication operator, write the method using the kn

> Yummy Catering provides meals for parties. In previous chapters, you have created an Event class that holds details for scheduled events, including an event number and number of guests. Now write an application that creates an array of five Event objects

> Write a program that prompts the user for an integer. Pass the integer to a method that determines whether the number is greater than 0; if it is, the method displays the number and passes one less than the parameter value to a second method. The second

> Write a program that prompts a user for two integers and then sums all the values between and including the two integers. Ensure that the second integer entered is larger than the first by continuing to reprompt the user until it is. Then pass the two in

> Write a program that allows you to create a file of customers for a company. The first part of the program should create an empty file suitable for writing a three-digit ID number, six-character last name, and five-digit zip code for each customer. The s

> Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. Depending on whether the student’s grade point average is at least 2.0, output each record either to a file of stud

> Write an application that allows a user to enter a filename and an integer representing a file position. Assume that the file is in the same folder as your executing program. Access the requested position within the file, and display the next 10 characte

> Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Write a program that reads in each account number in the file, and display whether the account number is valid. An account number is valid only if the last

> Create a program that allows a user to input customer records (ID number, first name, last name, and balance owed) and save each record to a file. Save the program as WriteCustomerList.java. When you execute the program, be sure to enter multiple records

> Write an application that determines which, if any, of the following files are stored in the folder where you have saved the exercises created in this chapter: autoexec.bat, CompareFolders.java, FileStatistics.class, and Hello.doc. Save the file as FindS

> Create a file that contains a line of your favorite song lyric. Use a text editor such as Notepad, and save the file. Copy the file contents, and paste them into a word-processing program such as Word. Write an application that prompts the user for the n

> Throughout the Case Problems in this course, you have been using a Rental class that obtains all the data for rentals from Sunshine Seashore Supplies, including details about the contract number, length of the rental, and equipment type. Now, create an a

> Yummy Catering provides meals for parties and special events. In previous chapters, you have developed an Event class that holds catering event information. Now modify the Event class as follows: ❯❯ Modify the method that sets the event number in the Eve

> The 1-year spot rate is 2 percent, the 2-year spot rate is 3 percent, the 3-spot rate is 4 percent, and the 4-year spot rate is 5 percent. a. How many forward rates are there over the four-year period? Identify each for- ward rate with the symbol tft1n w

> A three-year, 4 percent government bond is trading at $1,001. The spot yield curve indicates that the 1-year spot rate is 2 percent, the 2-year spot rate is 3 percent, and the 3-year spot rate is 4 percent. Is there an arbitrage opportunity, that is, is

> Suppose Snowmobile Inc. is considering whether or not to launch a new snowmobile. It expects to sell the vehicle for $10,000 over five years at a rate of 100 per year. The variable costs of making one unit are $5,000, and the fixed costs are expected to

> The market portfolio has an expected return of 11 percent with a 25 percent volatility. The risk-free rate is 5 percent. a. Investor A with $180,000 has a target expected return of 9 percent. How should he invest his $180,000? b. What are the volatility

> a. You hold an efficient portfolio. Which of the CML or the SML gives you the expected return on your portfolio? What could its composition be? b. You hold an inefficient portfolio. Which of the CML or the SML gives you the expected return on your portf

> Alvinstar Co. is considering investing in a new animal feed project. The product will be a soup for cats to be sold in cans. Alvinstar plans to sell 100,000 cans a year for four years at a price of $4 per can. Fixed costs will include rent on the product

> Astra Co. is considering introducing a bonus system based on economic value added (EVA) and has short-listed two bonus equations. The first one would simply compute the bonus as a percentage of EVA, such that: Bonus = x percent of EVA 5 x% 3 EVA (1) The

> Fiona Berling’s division of Mcsystems generates a net operating profit after tax, or NOPAT, of $1 million on an invested capital base of $1 million. The weighted average cost of capital of Ms Berling’s division is 20 percent. The division has been asked

> Below are the last three years’ financial statements of Sentec Inc., a distributor of electrical fixtures. a. Compute Sentec’s working capital requirement (WCR) on December 31, Year 1, Year 2, and Year 3. b. Prepare Se

> Suppose there are no government zero-coupon bonds. If investors demand default- free zeros, outline the process that would create these zeros using government coupon-paying bonds. Illustrate the method with the case of a four-year, 5 percent government z

> Equation 18.7 shows that market value added (MVA) of an investment project is the present value of the stream of the future economic value added (EVA) of the project. Because a firm can be viewed as a basket of investment projects, the MVA of a firm is s

> The Southern Communication Corporation (SCC) has $1 billion of capital invested in several telecommunication projects that are expected to generate a pre-tax operating profit of $170 million next year. SCC has an estimated pre-tax cost of capital of 15 p

> You want to test the speed with which stock market prices adjust to positive earnings’ announcements. Company A makes its earnings announcement on May 20 and Company B on June 16. You collected for each company daily share price returns

> The market portfolio has an expected return of 9 percent with a 10 percent volatility. The risk-free rate is 4 percent. A stock has a 20 percent volatility and a correlation coefficient of minus 0.10 with the market. a. What is the stock’s beta? What doe

> A project with a cash outlay now is followed by positive expected cash flows in the future and a positive net present value. What does this information tell you about the project’s discounted payback period, internal rate of return, profitability index,

> Following are the balance sheets at the end of year–1 and Year 0 followed by the Year 0 income statement of Sactor Inc. The annual report for Year 0 provides the following supplemental information: 1. The restructuring charge of $43 mil

> Identify at least three value drivers related to the management of operations and three strategic value drivers that directly affect economic value added (EVA). Show how these drivers might increase or decrease EVA.

> The Electronics Machines Corporation (EMC) is considering buying a $300,000 piece of equipment that could raise EMC’s sales revenues by $1 million the first year, $2 million the second year, and $1.8 million the third year. The cost of the piece of equip

> Explain why each of the following statements is generally incorrect: a. “The firm with the highest market value is the one that has created the most value for its shareholders.” b. “If a firm’s market value added (MVA) is positive, then its current retur

> Chateau Cheval Noir is one of the leading premium wine producers of France, with its 50-acre vineyard at St. Julien in the Bordeaux region. The owners have wanted to expand their production, but the scarcity and astronomical prices asked for vineyards ad

> Consider a two-year, 5 percent coupon bond selling at par. Answer the following questions. a. What is the bond’s yield to maturity? What assumption does the yield make regarding the first coupon payment? b. Assume that in a year the one-year market rate

> The Brankton Company, a US firm, considers investing in Spain. The investment will cost €125 million and is expected to generate, after taxes, €30 million a year during the next five years in real terms, that is, before inflation. The project would be li

> You are a currency arbitrager for a Japanese bank. The spot rate this morning is JPY/ USD 111.22, and early indications are that short-term interest rates in the United States (90-day rates) are about to rise from their current level of 3.125 percent. Th

> The finance manager of a US pharmaceutical company has $10 million to invest for six months. The annual interest rate in the United States is 3 percent. The annual interest rate in the United Kingdom is 1 percent. The spot rate of exchange is $1.60 per £

> As a trader, you can trade based on the following data: a. What is the return on one US-dollar deposit? b. What is the return in US dollars on a dollar-covered euro lending? c. Can the given information provide an arbitrage opportunity?

> How would you rank these three firms in decreasing order of expected debt ratios: a biotechnology firm, an auto-parts firm, and an electric utility firm? Explain.

> The Great Eastern Toys Company is evaluating a new product. The cash flows that are expected from this product over its five years’ expected life are shown below. Note that the final year’s cash flow includes $2,000 of

> Indicate in one sentence what the following parity relation says: a. Purchasing power parity relation b. International Fisher effect c. Interest-rate parity relation d. The relation between forward rates and future spot rate

> Refer to the data in Exhibit 3.12 to answer the following questions. a. What are the beta coefficients of the five stocks? b. What are the covariances and the correlation coefficients of the five stocks’ returns with those of the market portfolio? c. Sho

> Charles has a problem. His boss thinks that options are a form of gambling. The company he works for exports to European markets, which require euro invoicing. The market is cut-throat, and sales are made on the basis of competitive bidding. The average

> MPC imports computer equipment from Japan for sale in the US market. Monthly imports have averaged ¥250 million to ¥275 million over the past year. A similar volume is expected for the coming year. Because of the volatility of the exchange rate between t

> Thalin Inc. has decided to extend its current product line. To finance the project, the firm is considering issuing a ten-year, 10 percent coupon bond. The firm has made public that its target debt-to-equity ratio of 30 percent is not going to change in

> A major US clothes manufacturing and distributing company plans to expand in Asia. To reduce its transportation costs, it wants to set up its own manufacturing plant in Asia. Two countries are under consideration: China and Indonesia. The expected cash f

> A US-based multinational corporation has a wholly owned subsidiary in the Philippines that manufactures electronics products to be sold in the North American market. The equity of the Philippines subsidiary is 2,500 million Philippine peso (PHP) (from th

> The Pacific Food Company (PFC) has created a new concept restaurant that serves low-calorie healthy pizza at competitive prices. The restaurant costs $1.2 million to launch and is expected to generate a free-cash-flow stream with a present value of $1 mi

> The American Food Corporation (AFC) and the Canadian Mining Corporation (CMC) are considering a merger whose objective is to reduce the volatility of their combined assets. AFC assets are worth $100 million and have a 30 percent volatility; they are fund

> The board of the PQS Corporation has decided to give its employees 5 million of 4-year at-the-money call options on PQS stock. If the options are exercised, the company will issue new shares. There are 20 million PQS shares outstanding. PQS stock price i

> A 3-month European call option on VHQ shares trades at $5. Its exercise price is $50 and the stock price is currently $50.50. a. Using the put-call parity relationship, calculate the price of a put on VHQ shares with the same maturity and exercise price

> The Global Chemical Company (GCC) uses the following criteria to make capital investment decisions: 1. Effect on earnings per share (must be positive) 2. Payback period (must be less than six years) 3. Internal rate of return (must be at least 12 percent

> Lannion Co. is a manufacturing firm with no debt outstanding. It is considering bor- rowing $25 million at 8 percent and using the proceeds to buy back shares. Its equity market value is $100 million, and its profits are taxed at 35 percent. a. What woul

> Return to the WTM case in the chapter where it is said that WTM could hedge its exposure to the price risk of copper by purchasing a call option for $336 that would give it the right to buy one ton of copper in three months for $6,000. The spot price of

> You own a $1.5 million diversified portfolio of stocks that you will have to sell in three months’ time to finance the purchase of a house. Fearing that the stock market might go down significantly over the next three months, you would like to hedge your

> Motoran Inc. is contemplating the acquisition of a competitor, Tortoran Corp., for $25 million. Motoran’s market value is $40 million, whereas that of Tortoran is $20 million. Motoran expects that after the merger the administrative costs of the two comp

2.99

See Answer