Explain the concept of files and streams

Assignment Help JAVA Programming
Reference no: EM13942435

742 Chapter 14 Files and Streams

14.12 (Telephone-Number Word Generator) Standard telephone keypads contain the digits area through through nine. The numbers two through nine each have three letters associated with them (Fig. 14.43). Many people find it difficult to memorize phone numbers. so they use the correspon¬dence between digits and letters to develop seven-letter words that correspond to their phone mute bers. For example, a person whose telephone number is 686-2377 might use the correspondence indicated in Fig. 14.43 to develop the seven,letter word "NUMBERS." Every seven-letter word car-responds to exactly one seven-digit telephone number. A restaurant wishing to increase its takeout business could surely do so with the number 825-3688 (i.e., "TAKEOUT").

Every seven-letter phone number corresponds to many different seven-letter words. Unforte. nately, most of these words represent unrecognizable juxtapositions of letters. It is possible, how¬ever, that the owner of a barbershop would be pleased to know that the shop's telephone number, 424-7288, corresponds to "HAIRCUT." The owner of a liquor store would, no doubt. be delighted to find that the store's number. 233-7226, corresponds to "BEERCAN." A veterinarian with the phone number 738-2273 would be pleased to know that the number corresponds to the letters "PETCARE." An automotive dealership would be pleased to know that the dealership num¬ber, 639-2277, corresponds to "NEWCARS."
Write a program that, given a seven-digit number, uses a PrintStream object to write to a file every possible seven-letter word combination corresponding to that number. There are 2.187 (3') such combinations. Avoid phone numbers with the digits 0 and

at 13 (Student Poll) Figure 7.8 contains an array of survey responses that is hard coded into ill program. Suppose we wish to process survey results that are stored in a file. This exercise minim two separate programs. First, create an application that prompts the user for survey responses and outputs each response to a file. Use a Formatter to create a file called numbers.txt. Each integer should be written using method format. Then modify the program in Fig. 7.8 to read the survey responses from numbers . txt. The responses should be read from the file by using a Scanner. Meth¬od nextint should be used to input one integer at a time from the file. The program should con tinue to read responses until it reaches the end of file. The results should be output to the text file "output .txt".

Modify Exercise 1 1 . 18 to allow the user to save a drawing into a file or load a priordrawin& from a file using object serialization. Add buttons Load (to read objects from a file), Save (to write objects to a file) and Generate Shapes (to display a random set of shapes on the screen). Use an ObjectOutputStream to write to the file and an ObjectinputStream to read from the file, Write the array of MyShape objects using method writeObject (class ObjectOutputSt ream), and read the array

310_kk.png

Reference no: EM13942435

Questions Cloud

Details of at least two organisations using erp systems : Your explanation should include definitions and details of at least two organisations using ERP systems and the benefits they achieved.
Use of sdlc and agile development approaches : Compare the use of SDLC and agile development approaches. Justify your choice of your selected approach to systems development.
Topic-king abdullah scholarship program : Specific Purpose: To inform to the audience about king Abdullah scholarship programand what are the goals of it.
Explore and summarize the cereals.xls dataset : For each of the 16 variables in the dataset, state whether the variable is categorical (qualitative) or numerical (quantitative).For categorical variables, state whether the variable is nominal or ordinal.
Explain the concept of files and streams : Every seven-letter phone number corresponds to many different seven-letter words. Unforte. nately, most of these words represent unrecognizable juxtapositions of letters.
Analyse what meant by moral values in mid-victorian britain : 'Victorian moral values were shared by all.' Analyse what was meant by 'moral values' in mid-Victorian Britain, with particular reference to the lives of the working classes.
Analyse the contributions of the early greeks : Legal Theory 1000 word Essay Answer one of the following three questions 1. Analyse the contributions of the early Greeks, the Romans and the early Christians to the concept of natural law and natural rights.
Why is a logical linear sequence useful : Why is it logical to write test items or assessments before producing instructional strategies? Why is a logical linear sequence useful, even though in practice instructional design components may be more concurrent
The chapter and reflecting on the information : 1. After reading the chapter and reflecting on the information, what are three influential factors from your childhood environment that helped to shape who you are today? What are three important biological or genetic traits that helped to shape who ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd