Introduction to Java Programming and Data Structures Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134700144
Author: Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 17, Problem 17.9PE
(Address book) Write a program that stores, retrieves, adds, and updates addresses as shown in Figure 17.20. Use a fixed-length string for storing each attribute in the address. Use random-access file for reading and writing an address. Assume the sizes of the name, street, city, state, and zip are 32, 32, 20, 2, and 5 bytes, respectively.
FIGURE 17.20 The application can store, retrieve, and update addresses from a file. Source: Copyright © 1995–2016 Oracle and/or its affiliates. All rights reserved. Used with permission.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In C Programming Language.
- use user-defined functions.- use an array of arrays.- use file pointers- use string processing and character conversions.- use a dynamic memory function calloc() or malloc()
- Demonstrate the ability to read a file and process the data.
Problem:
You are tasked to write a program that will perform a statistical analysis of student records. Your program will open a text file (provided) and store the values read into an array (2d). Your program will then close the input file and process the data. Your program will print out the records to screen and will then print out the average quiz scores per student.For each student in the provided text input file there is a name of up to 20 characters, an id number of five alphanumeric values (n1234), 4 exm grades in order: exm 1 – exm 4.You may use a fixed 2d array size of 80 characters for the input file name. You must use a dynamic array for at least one task in your program. You may declare your filename array using…
Create a program to compress and decompress a file. (Files from flashdrive)
Must include or consider the ff:
Data Strutures (list/array/tree/graph)
Time Complexity (choose the best algorithm)
Programming Language can be any of the ff:
Python
Java
C++
C#
C
. (True/False): A segment selector points to an entry in a segment descriptor table
Chapter 17 Solutions
Introduction to Java Programming and Data Structures Comprehensive Version (11th Edition)
Ch. 17.2 - What is a text file and what is a binary file? Can...Ch. 17.2 - How do you read or write text data in Java? What...Ch. 17.3 - Prob. 17.3.1CPCh. 17.3 - How is a Java character represented in the memory,...Ch. 17.3 - If you write the string ABC to an ASCII text file,...Ch. 17.3 - If you write the string 100 to an ASCII text file,...Ch. 17.3 - What is the encoding scheme for representing a...Ch. 17.4 - Prob. 17.4.1CPCh. 17.4 - Why should you always close streams? How do you...Ch. 17.4 - Prob. 17.4.3CP
Ch. 17.4 - Does FileInputStream/Fi1eOutputStream introduce...Ch. 17.4 - What will happen if you attempt to create an input...Ch. 17.4 - How do you append data to an existing text file...Ch. 17.4 - Prob. 17.4.7CPCh. 17.4 - What is written to a file using writeByte(91) on a...Ch. 17.4 - How do you check the end of a file in an input...Ch. 17.4 - What is wrong in the following code? Import...Ch. 17.4 - Suppose you run the following program on Windows...Ch. 17.4 - After the following program is finished, how many...Ch. 17.4 - For each of the following statements on a...Ch. 17.4 - What are the advantages of using buffered streams?...Ch. 17.5 - How does the program check if a file already...Ch. 17.5 - How does the program detect the end of the file...Ch. 17.5 - How does the program count the number of bytes...Ch. 17.6 - Prob. 17.6.1CPCh. 17.6 - Prob. 17.6.2CPCh. 17.6 - Is it true that any instance of...Ch. 17.6 - Prob. 17.6.4CPCh. 17.6 - Prob. 17.6.5CPCh. 17.6 - What will happen when you attempt to run the...Ch. 17.7 - Can RandomAccessFi1e streams read and write a data...Ch. 17.7 - Create a RandomAccessFi1e stream for the file...Ch. 17.7 - What happens if the file test.dat does not exist...Ch. 17 - (Create a text file) Write a program to create a...Ch. 17 - (Create a binary data file) Write a program to...Ch. 17 - (Sum all the integers in a binary data file)...Ch. 17 - (Convert a text file into UTF) Write a program...Ch. 17 - Prob. 17.5PECh. 17 - Prob. 17.6PECh. 17 - Prob. 17.7PECh. 17 - (Update count) Suppose that you wish to track how...Ch. 17 - (Address book) Write a program that stores,...Ch. 17 - (Split files) Suppose you want to back up a huge...Ch. 17 - (Split files GUI) Rewrite Exercise 17.10 with a...Ch. 17 - Prob. 17.12PECh. 17 - (Combine files GUI) Rewrite Exercise 17.12 with a...Ch. 17 - (Encrypt files) Encode the file by adding 5 to...Ch. 17 - (Decrypt files) Suppose a file is encrypted using...Ch. 17 - (Frequency of characters) Write a program that...Ch. 17 - (BitOutputStream) Implement a class named...Ch. 17 - (View bits) Write the following method that...Ch. 17 - (View hex) Write a program that prompts the user...Ch. 17 - (Hex editor) Write a GUI application that lets the...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- c# (File of Student Grades) Create a program that stores student grades in a text file. The file should contain the name, ID number, class taken and grade of every student. Allow the user to load a grade file and display its contents in a read-only TextBox.arrow_forward2. [summary_report.py] Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 1.5h 3.25h 3.8h 6.Oh 1.eh 5. 5h 2.25h 0.75h 2.25h 3.0h 3.0h 5.75h 2.25h A report could be produced by a program like this: 0.00h | 5.25h | 1.5en 3.25h 0.5eh 10.00h 0.00h 3.00h 6.00h 1.00h 8.50h 5.50h 2.25h 8.75h 8.25h 8.00h 0.00h | e.00h 2.25h 3.00h 3.00h 5.75h 2.25h Weekly Total: 40.00h Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data types, and string formatting. create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a running total, then writes the report to an output file. Your program should prompt a user to input a…arrow_forwarduse java languagearrow_forward
- Q2) An image is a matrix of pixels. You must have seen two types of images: color andgrayscale. A color image pixel has three colors: Red, Green, and Blue, but a grayscale imagepixel has only one color: Gray. Regardless of the image type, a color always has an 8-bitinteger value (0-255) associated with it. You need to implement a program that can input,create, update and display the images (matrices). It should be able to compute their negatives(matrices) as well. NOTE: You need to generalize the computation of negatives, for we onlyneed to subtract the color values from 255, regardless of the image type.arrow_forward<<Write in Java>> - Challenge 7 File encryption is the science of writing the contents of a file in a secret code. Your encryption program should work like a filter, reading the contents of one file, modifying the data into a code, and then writing the coded contents out to a second file. The second file will be a version of the first file, but written in a secret code. Although there are complex encryption techniques, you should come up with a simple one of your own. For example, you could read the first file one character at a time, and add 10 to the character code of each character before it is written to the second file. - Challenge 8 Write a program that decrypts the file produced by the program in Programming Challenge 7. The decryption program should read the contents of the coded file, restore the data to its original state, and write it to another filearrow_forwardPlease,Explain your work. Thank you!arrow_forward
- python help, fill in the "your response" parts Write function quoteByNum() that takes as input the name of a file (as a string) and an index i (as an integer). The file will contain quotes, one per line. The function should open the file, read the file, close the file, and return the i-th quote (i.e. the i-th line in the file), assuming that the quote numbering starts at 0. Test your solution on file Wilde_Quotes.txt.>>> quote("Wilde_Quotes.txt", 5)'At twilight, nature is not without loveliness, though perhaps its chief use is to illustrate quotations from the poets.\n'>>> quote("Wilde_Quotes.txt", 0)'A little sincerity is a dangerous thing, and a great deal of it is absolutely fatal.\n'>>> quote("Wilde_Quotes.txt", 23)'Patriotism is the virtue of the vicious. \n'>>> def quoteByNum(file, int1): your response (docstring) infile = open(file) # your response content = infile your…arrow_forwardMerge two files (1 point) Write a program that reads the content of two files “text1.txt” and “text2.txt" line by line and merges them into another file called “merge12.txt". You can safely assume that the input is valid. IN C PROGRAMMINGarrow_forwardQ1: write a M-file mat lab program call it Eql.m file to enter a square matrix A(m,m) and find the following: 1. The summation of main diagonal. 2. The summation of upper triangle. 3. The summation of lower triangle.arrow_forward
- (True/False): A segment description includes a segment's base location.arrow_forwardDebug the following phython code. """This function reads in data from the file specified by filename. This data is read line by line and unpacked into a single variable called data. argumentsfilename - the name of the file to be read returnsdata - a list of data, each element is a list that corresponds to the set of entries separated by commas in the original file. To access the first entry use data[0]. If x = data[0], then x[0], through x[3] will correspond to entries in the file that are read in. """ def read_file(filename):fin = open(filename,'r')line = fin.readline()data = []while line:data.append(parse_line(line))line = fin.readline()return dataarrow_forwardPlease choose the correct answer without exsplaining.. Thank youarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Algebraic Expressions – Algebra Basics; Author: TabletClass Math;https://www.youtube.com/watch?v=U-7nq7OG18s;License: Standard YouTube License, CC-BY
Python Tutorial for Beginners 3 - Basic Math, Mathematical Operators and Python Expressions; Author: ProgrammingKnowledge;https://www.youtube.com/watch?v=Os4gZUI1ZlM;License: Standard Youtube License