Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Digital Fundamentals (11th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Programming Logic and Design (4th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
- A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a file. The program should output the unique words and their frequencies in alphabetical order. Variations are to track sequences of two words and their frequencies, or n words and their frequencies. Below is an example file along with the program input and output: example.txt I AM SAM I AM SAM SAM I AMarrow_forwardpython Write a function that reads in a text file, and counts the number of times each word occursin the file. Then print the words alphabetically with its corresponding count. Each word willbe separated by a space or newline, but there is no guarantee that each word will be on aseparate line.arrow_forwardWrite a function called countWord(). It takes 2 parameters: The name of a text file(e.g. gettysburg.txt) and a word to be searched within that file. Your code should returnthe number of times the given word appears in the file.>>> countWord('gettysburg.txt', 'people')3arrow_forward
- Must be written in Python.arrow_forwardQuestion 3: Write a program that reads a file of text and displays the number of words in that file. The filename is entered by the user. A Word is defined to be any number of consecutive letters (a...z, A...Z) only. Words are separated from each other by spaces (* “) and/or commas (*,') and/or semicolon (*;') and/or full stop (':'). Your program should write the words in the file "output.txt" along with the total word count. As shown below. file.txt Abedef, ;; gfdyire hsdhfkdsf, , ; , dkjfkjdljkfldj. .. mnbsdT .. ;; nbmxhs , a djks. output.txt Abcdef gfdyire hsdhfkdsf dkjfkjdljkfldj mnbsdT nbmxhs a djks Total count of words are = 8arrow_forwardProgramarrow_forward
- The file text.txt contains a sentence text written in all small letters and does not have any punctuation marks, no numbers, no symbols except for spaces. You are required to write a program which accepts an operation code, and zero to two inputs depending on the operation code. Based on the operation code, you will call three versions of the overlaoded function textProcessing as follows: ● Operation 0: The function removes all vowels from the ORIGINAL sentence. The vowels considered are the small letters (a, e, i, o, u y, and w). • Operation 1: The code further asks for one lowercase letter to be input by the user. If the character is not a lower case letter, the code outputs Invalid.The function returns the distance (difference) between the letter first occurence and last occurence in the text. If the letter does not occur in the sentence, it returns 0. • Operation 2: The code asks for two lowercase letters to be input by the user. If the characters are not lower case letters, the…arrow_forwardpython please! the first answer i received didn't check out. it is graded by a computer on autolab. im so confusedarrow_forwardWrite a CPP program to read students information from a file named (f1.csv). The file contains information for 100 students. Each student has one line consists of: Name(string), prg(int), logic(int), math(int), level(string). The above parts are separated by commas (,). The program is required to write the following information on a second filed named (smmary.txt): a- The highest mark in programming (prg). b- The lowest mark in logic. c- The average of math marks. After that, the program needs to create two more files named (passed.txt) and (failed.txt) respectively. The first file contains all the students who passed in all subjects. The second file contains all the students who failed in one or more subjects.arrow_forward
- Do not read directly from the example files, as the automated testing system expects you to read from the standard input. Instead, process the lines as follows: 3 - Geography Grades 3 Make a copy of your program for the problem Geography Grades 2 and change the code in such a way that your program can process multiple groups. These groups are on the input separated by ’=\n’. Every group starts with a first line that contains the name of the group and the lines after contain the information about the students in the same way as is specified for the problem Geography Grades 1. With the input 1bErik Eriksen__________4.3 4.9 6.7Frans Franssen________5.8 6.9 8.0=2bAnne Adema____________6.5 5.5 4.5Bea de Bruin__________6.7 7.2 7.7Chris Cohen___________6.8 7.8 7.3Dirk Dirksen__________1.0 5.0 7.7 The output should be: Report for group 1bErik Eriksen has a final grade of 6.0Frans Franssen has a final grade of 7.0End of reportReport for group 2bAnne Adema has a final grade of 6.0Bea de Bruin…arrow_forwardGiven a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate lists, and outputs the available food items in the following format: name (category) - description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character ('\t'). Ex: If the input of the program is: food.txt and the contents of food.txt are: Classic ham sandwich Available sandwich Chicken salad sandwich Not available Classic cheeseburger Cheeseburger Not available Salads Water 16oz bottled water Available Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Beverages Beverages Mexican food…arrow_forwardWrite a C++ program that opens three files (i.e. s1.txt, s2.txt, and s3.txt) and reads the data of three students. Each file contains the student first name and last name separated by a space and the student grades in three subjects as double floating-point numbers on the next line. The program should output the data in table format such that the data of each student is displayed on one line. The data of the students is ordered in the table alphabatically according to their names. The last column in the table contains the average grade of each student. The last row in the table contains the maximum grade in each subject. Notice that the width of the first column in the table is 20 and its is aligned to the left. All remaining columns have width of 7 and their data is aligned to the right. Also Notice, that all the numbers in the table must be displayed with exactly two decimal digits. IMPORTANT NOTES . Do not add any cout statements except for the final outputs as shown in the sample…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT