Suppose that you have two text files that contain sequences of integers separated by whitespace (blank space, tabs, and line breaks). The integers in both files appear in sorted order, with smaller values near the beginning of the file and large values closer to the end. Write a pseudocode
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
Starting Out With C++: Early Objects, Student Value Edition (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
C++ How to Program (10th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
- Using JAVA, write a program that reds a file containing two columns of floating-point numbers. Prompt the user for a file name. Print the average of each column on screen as well as a separate file.arrow_forwardPython Pandas: Suppose I have a file with columns I want to specify the spacing so that there are 5 spaces between the columns, how do I do this? file1 12 12.3 9.3 23 3.5 45.6 34 6.1 88.9arrow_forwardIn Python. I am suppose to write a file using this code that takes the info in the names file and puts it into the sorted_names file. It won't work. I've enclosed the code as an image file. Or I didn't know if it's all supposed to run at once like: print("micpor9577") def readfile(): path = "C:\\PythonFiles\\names.txt" names = [] fopen = open(path, "r") for line in fopen: line = line.replace("\n","") names.append(line) fopen.close return names names = readfile()names.sort()print(names) def writefile(names): path = "C:\\PythonFiles\\sorted_names.txt" fopen = open(path, "w") for line in names: fopen.write(line + "\n") fopen.close()arrow_forward
- Write a program that reads the-zen-of-python.txt and writes each line to UpdatedZen.txt, a new text file. It capitalizes the first character of each line and adds a period to the end of each line before writing it back to updatedzen.txt. the-zen-of-python.txt file contents: beautiful is better than ugly explicit is better than implicit simple is better than complex complex is better than complicated flat is better than nested sparse is better than dense readability counts special cases aren't special enough to break the rules although practicality beats purity errors should never pass silently unless explicitly silenced in the face of ambiguity, refuse the temptation to guess there should be one-- and preferably only one --obvious way to do it although that way may not be obvious at first unless you're Dutch now is better than never although never is often better than *right* now if the implementation is hard to explain, it's a bad idea if the implementation is easy to explain, it…arrow_forwardWhat is the difference between a binary file and a text file? Is it possible to use a text editor to see a text or binary file?arrow_forwardWrite an automated censor program that reads in the text from a file andcreates a new file where all of the four-letter words have been replaced by11 **** 11• You can ignore punctuation, and you may assume that no wordsin the file are split across multiple lines.arrow_forward
- write a program in java. Suppose a file “ABC.txt” contains three integers separated by commas. Write a program that usethe existing file, read the integers and display them in reverse order separated by spaces.Secondly, get string input from user and append an existing file. Finally, count the number ofwords in a file.arrow_forwardSuppose a library is processing an input file containing the titlesof books in order to remove duplicates. Write a program thatreads all of the titles from an input file called bookTitles.txtand writes them to an output file called noDuplicates.txt.When complete, the output file should contain all unique titlesfound in the input file.arrow_forwardSuppose a file “ABC.txt” contains three integers separated by commas. Write a program that use the existing file, read the integers and display them in reverse order separated by spaces. Secondly, get string input from user and append an existing file. Finally, count the number of words in a file write code in javaarrow_forward
- Create a flex file which recognizes if a given string is a word or a number. (Here we have 3 possibilities: word, number, other)Create a flex file which recognizes if a given string is an email address.Create a flex file which counts how many words start with a capital letter.Make calculator also run with float numbers.Create a calculator (multiplication, addition, division, extraction) for binary numbers.arrow_forwardWrite a program that reads two input files whose lines are ordered by a key data field. Your program should merge these two files, writing an output file that contains all lines from both files ordered by the same key field. As an example, if two input files contain student names and grades for a particular class ordered by name (the key field), merge the information as shown below. File 1 and file 2 are supplied. Here is an algorithm to merge the data from two files: Read a line from each data file While the end of both files has not been reached While the end of both files has not been reached Write the line from file 1 to the output file and read a new line from file 1. Else Write the line from file 2 to the output file and read a new line from file 2. Write the remaining lines (if any) from file 1 to the output file. Write the remaining lines (if any) from file 2 to the output file. See the Merging Filesslides attachedto the project in Canvasfor a visual look at this algorithm.arrow_forwardSuppose a file “ABC.txt” contains three integers separated by commas. Write a program that use the existing file, read the integers and display them in reverse order separated by spaces. Secondly, get string input from user and append an existing file. Finally, count the number of words in a filearrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT