EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 13, Problem 20RQ
<PROGRAM-DESCRIPTION-ANSWER>
A file channel “is seekable”.
Hence, the correct answer is option “C”.
</PROGRAM-DESCRIPTION-ANSWER>
Explanation of Solution
File Channel:
- A file channel is a SeekableByteChannel that is connected to a file. It has a current position within its file that can be both queried and modified.
- The file itself contains a variable-length sequence of bytes, which can be read and written and whose current size can be queried...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a program to read the names stored in three different files: file1.txt, file2.txt and file3.txt and sort all the names from all these files and store the sorted names in file4.txt
file1.txt
Sridhar
Mahesh
file2.txt
Sri Ramana
Siva Sai Ram
file3.txt
Sunil-CR
Raja
file4.txt
Mahesh
Raja
Siva Sai Ram
Sri Ramana
Sridhar
Sunil-CR
Write a program that reads integers from a file, sums the values and calculates the average.
Write a value-returning function that opens an input file named txt. You may "hard-code" the file name, i.e., you do not need to ask the user for the file name. The function should check the file state of the input file and return a value indicating success or failure. Main should check the returned value and if the file open fails, output a message to cout and exit the program.
Write a void function that reads the integers from the data file, sums the values and calculates the average of the values. Return the sum of the values, number of values read and the average of the values to the calling module, main. Since you do not know the number of values in the file, you must check for end of file.
In main, output to cout the sum, number of values read and the average.
Include the function prototypes
Declare the variables necessary to create a running program.
Write statements for all…
This program asks you to sort the letters in an input file and print the sorted letters to an output file (or standard output) which will be the solution. Your program, called codesolve, will take the following command line arguments:
% codesolve [-o output_file_name] input_file_name
Read the letters in from the input file and convert them to upper case if they are not already in uppercase. If the output_file_name is given with the -o option, the program will output the sorted letters to the given output file; otherwise, the output shall be to standard output.
In addition to parsing and processing the command line arguments, your program needs to do the following:
You need to construct a doubly linked list as you read from input. Each node in the list will link to the one in front of it and the one behind it if they exist. They will have NULL for the previous pointer if they are first in the list. They will have NULL for the next pointer if they are last in the list. You can look up…
Chapter 13 Solutions
EBK JAVA PROGRAMMING
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
- Answer the given question with a proper explanation and step-by-step solution. Write a function named file_sum that takes as a parameter the name of a text file that contains a list of numbers, one to a line, like this:```23.7711694-12.8014.999```The function should sum the values in the file and write the sum (just that number) to a text file named sum.txt.The file must be named: **file_sum.py**arrow_forwardWrite a CPP program to do the following: Read the attached text file "DISTRICT-COSC-1437.txt". Uppercase each line and write the uppercase results to a file named "UpperCased1437.txt". This is the target file. If the target file exists when the program starts, prompt to overwrite the file. If declined, then do not process. Deliverable is a working CPP program. Textfile DISTRICT-COSC-1437.txt COSC-1437 Tarrant County College Page 1 of 2 COSC-1437 Programming Fundamentals II TARRANT COUNTY COLLEGE DISTRICT MASTER SYLLABUS COURSE DESCRIPTION This course focuses on the object-oriented programming paradigm, emphasizing the definition and use of classes along with fundamentals of object-oriented design. The course includes basic analysis of algorithms, searching and sorting techniques, and an introduction to software engineering processes. Students will apply techniques for testing and debugging software. This course is included in the Field of Study Curriculum for Computer Science.…arrow_forwardPlease in C Language Write a program that uses an existing text file (text.txt) to determine the number of occurrences of each letter. You can assume that the file is filled with only lowercase letters and only the letters from a-z are present! Write the result in a new file to be created by the program! Errors when opening and closing the files must be caught!arrow_forward
- Write a program that asks for the name of an input file. Then, read all the numbers in the file, and display the following information to the screen: count of numbers in the file sum of all numbers in the file average of all numbers in the file (to 2 decimal places) count of numbers in each range (100-199, 200-299, 300-399, etc.) The program should: display a hello message ask the user for an input file display the name of the input file validate the file opens correctly display statistical information as shown above display a goodbye messagearrow_forwardchoose the correct ans : 1. What is use of eof() ?a. Returns true if a file open for reading has reached the next character.b. Returns true if a file open for reading has reached the next word.c. Returns true if a file open for reading has reached the end.d. Returns true if a file open for reading has reached the middle. 2.The mechanism of giving special meaning to an operator is called ____a. Objectb. Inheritancec. Function overloadingd. Operator Overloading 3) Local variables are stored in an area called ___________a) Heapb) Permanent storage areac) Free memoryd) Stack 4)Which of the following is/are valid ways to allocate memory for an integer by dynamic memory allocationin CPP?a. int *p = new int(100);b. int *p; p = new int; *p = 100;c. int *p = NULL; p = new int; *p=100;d. Only 1,2e. All of these 5)Choose the correct option? #include<iostream> using namespace std; class Base {}; class Derived: public Base {}; int main() { Base *bp = new Derived; Derived *dp = new Base; } a.…arrow_forward13. After you define a file pointer, you can connect that pointer to a file with fread () fopen ( ) fseek () fprintf ( ) a. b. С. d.arrow_forward
- This program asks you to sort the letters in an input file and print the sorted letters to an output file (or standard output) which will be the solution. Your program, called codesolve, will take the following command line arguments: % codesolve [-o output_file_name] input_file_namearrow_forward$readmemb is used to initialize memory from a text file in hexadecimal values. True False It is a keyword used in the HDL code to import the hexadecimal contents of a text file into a memory variable. "When iCE is disabled in the memory module, the output in the tWbus is zero." True False When iCE is enabled in the memory module, the output in the tWbus is the memory address." True False eg [6:0] Memory [0:16] means the memory contains ___ bits per address 17 7 6 16 When iCE is disabled in the memory module, the output in the tWbus is high impedance" True False NEED ANSWERS QUICK NO EXPLANATION NEEDEDarrow_forwardPlease in C Language (CYBER SECURITY) Write a program that uses an existing text file (text.txt) to determine the number of occurrences of each letter. You can assume that the file is filled with only lowercase letters and only the letters from a-z are present! surfing is a type of social engineering attac Shoulder surfing does not involve Write the result in a new file to be created by the program! how people behave. Errors when opening and closing the files must be caught! rely on? his attack? Note that solutions that rely onarrow_forward
- Fill up Q. _____________ is used for creating jus a pipe file.arrow_forwardWriteaC++programthatpromptstheusertoenterafilenamethatcontains the total mark of students. Each line in the input file contains a student name followed by the student’s total mark. The program should ask the user for the passing threshold (i.e. student whose total mark is greater than or equal the threshold will pass the course) and copy the students who pass the course to a new file (the name of the output file is specified by the user). Moreover, the output file should be format so that all the marks are displayed with two digits after the decimal point. The width for the names and marks fields should be eight and seven, respectively. A sample input and output files are shown below (the passing mark in this sample is assumed to be 60). Total.txt Ahlam 80.123 Bader 83.1 Nabil 91.25 Khoula 70 Saif 55.333 Salem 50 Sultan 92.5 Qais 77.2arrow_forwardwrite a program that computes and prints the average of the numbers in a text file. you should make use of two higher-order functions to simplify the design 1. Modify the data in numbers.txt 45.6 66.7 88.8 100.3 22.4 98.1 2. Run the average.py and numbers.txt to get the desired output. Enter the input file name: numbers.txt The average is 70.31666666666666 3. Please explain the algorithm in 3 sentences Please screenshot input ans output windowarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License