Write a program that reads from a text file named "sales.txt", which contains the sales figures (double) of a store. Your program should: • Display the average, the highest, and the lowest sales figures Remember to: • Test the file open error Close the file at the end.
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: The main objective of the given problem is to take input from the command prompt. The arguments…
Q: 5. Write a program that checks whether a sequence of HTML tags is properly nested. For each opening…
A: using linked list Linked list is a linear data structure in which elements are not stored at…
Q: Write a program that allows the user to create and maintain a list of contacts in a file contact…
A: Code: #include <iostream>#include <fstream> using namespace std; void printList() {…
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: Program in C++: #include <iostream>#include <fstream>#include <cstdlib>#include…
Q: Write a Python program that reads each line of an input file temperatures.txt that consists of a…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: Program in C language. Implementing the command line argument Using file pointer. Declared a…
Q: Write a program count.c that reads an existing ASCII text file, and prints on sere screen the number…
A: [C Program]#include <stdio.h>#include <stdlib.h> //main function with command line…
Q: Write a Python program that reads each line of an input file temperatures.txt that consists of a…
A: Algorithm : Step 1 : opening the file temperature.txt in read mode and tempSummary.txt in write…
Q: Write a program that reads a file in.txt containing marks of 5 students. The program calculates the…
A: As no programming language is mentioned, it is solved using basic C++
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: Step 1: Get the file name and option from the command line. Step 2: Open the file in read mode using…
Q: Write a program that opens a file me.txt and write your first name followed by a space followed by…
A: The program has been written in python language.
Q: Write a program that reads a stream of integers from a file and writes only the positive numbers to…
A: The program is written in Java. Please check the below step for the source code.
Q: Write a program that asks the user for the name of a text file. The program should display the last…
A: Lets see the solution.
Q: Write a program that enters data of 10 bank accounts and write on a file Account.txt file. Account…
A: CODE : #include<stdio.h> #include<string.h> //Structure for Bank Account struct…
Q: Write a program that opens a text file called quiz.txt for reading. This file contains a single line…
A: Note: Programming language is missing in the question. So we will answer this program in C++. If you…
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: ALGORITHM:- 1. Take input for file name from user. 2. Read the data from it. 3. Write that data into…
Q: Write a program which reads the content of two files “text1.txt” and “text2.txt” line byline and…
A: This program is dealing with the file operations in C programming. In C, pointers are used to…
Q: Make a program that reads lines from a file called numbers.txt where the lines are integers…
A: Step 1 : Start Step 2 : Open the numbers.txt file in read mode , the products.txt file in append…
Q: This assignment involves writing a program that takes reads from a text file containing multiple…
A: 1. Open the file 2. loop through each line of file i. split the file into array using…
Q: Write a program that reads a file of numbers of type int and writes all the numbers to another file,…
A: #include <iostream>#include <iomanip> // re. setw#include <fstream> using…
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: Code:- #include <iostream>#include <string>#include <fstream>using namespace std;…
Q: Write a Python program sentences.py that prompts for multiple sentences. The program should write…
A: Python Reverse each word in a sentence
Q: Create a program that reads a text file containing a 15 x 15 grid which represents a block of human…
A: Java Source Code: import java.util.ArrayList;import java.io.FileReader;import…
Q: Write a program that use the existing file, read the integers and display them in reverse order…
A: import java.util.*; class main { // Recursive function to print from N to 1static void…
Q: A program that will read line of a stream of integers from a FILE. Reverse each number and compute…
A: SUMMARY: -Hence, we got the output.
Q: Create a program that reads the text file called "data.txt". Column O contains the patient number…
A: NumPy is the python built-in package that has the functions to create an array and multidimensional…
Q: write a program with python that asks the user to enter two filenames. One file contains a list of…
A: Note: Follow proper indentation as specified in the code snapshot while implementing code. Random…
Q: Write a program, and store it in a file called Travel Expenses.xlsm, that does the following: (a) It…
A: Macro code is below: Option Explicit Dim firstName As String Dim lastName As String Dim nMiles…
Q: Write a program in python language using basics that takes multiple student marks as input. If a…
A: Use an infinite loop to accept input from user and exit from loop if the user input marks is…
Q: Write a program that reads a file consisting of students' test scores in the range 0-200. It should…
A: Store the given scores in a text file and open a file in reading mode using the ifstream object.…
Q: Write a program that removes all the occurrences of a specifiedstring from a text file. For example,…
A: A Java program is as follows, import java.io.*; import java.util.*; public class Exercise12_11 {…
Q: Write an application that removes extra spaces from a text file. In the days of the typewriter, it…
A: The code in Java is : import java.io.BufferedReader; import java.io.FileNotFoundException; import…
Q: Write a program that will read a message from another text file and surround each occurrence of an…
A: Coded using Java.
Q: Write a python program that read a text file 'count.txt', and should count and display the…
A: Please find the answer below
Q: Write a program that asks the user for the name of a text file, and then prints to the screen the…
A: import osimport sys def main(): file_name = input("Enter the name of the file: ") if…
Q: Write a program that meets the followingrequirements:■■ Get an audio file from the class directory…
A: Program approach Import required classes from JavaFX packages. Create a class PlayAudio that…
Q: Write a program that readswords from a text file and displays all the words (duplicates allowed)…
A: PROGRAM: //Header files import java.io.*; import java.util.*; //Defining the class class Main {…
Q: Write a Java GUI program using BufferedReader that asks the user to input the file to be opened. If…
A: import javax.swing.*; import java.awt.event.*;import java.awt.*;import java.io.*;public class…
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: C programming is a general-purpose, procedural, imperative computer programming language developed…
Q: Write a program that inputs the names of fifteen cities and stores them in a file city.txt and then…
A: Task: Write a program that inputs the names of fifteen cities and stores them in a file city.txt and…
Q: program that reads 5 integer numbers from a file"integer.txt",and store sum and average in…
A: Program: # python version 3import sysdef main(): # open the file read_file =…
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: The objective of the given problem is to take the input switch and file name from the user through…
Q: Write a program to do the following: - 1) Read the file Mydata.txt which includes unlimited number…
A:
Q: Write a C program Write a program that will write the integer values from 1 to 100, one integer per…
A: To write a program that will write the integer values from 1 to 100, one integer per line, onto a…
Q: Write a program that prompts the user to enter the name ofan author and the title of one their…
A: Program: //Import necessary header files import java.io.*; import java.util.Scanner; //Define a…
sales-1.txt
284.12
223.09
579.12
998.65
1237.84
764.75
395.65
458.01
670.35
3765.00
3842.10
190.23
335.35
662.95
2719.25
3564.02
193.23
222.23
1457.20
89.75
1323.65
234.35
789.89
224.67
663.95
245.38
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- OWrite a program that reads data from a file containing integers that ends with -999. Output the numbers that are divisible by 7 Output the numbers that are divisible by 11 Output the numbers that are not divisible by 7 or 11.Python please: Given a text file named RandomTextFile.txt that contains newline characters, write a program that removes all the newline characters from the file. Your program should use the filename as input, and the output file should use the same filename as the original. Use the attached file RandomTextFile.txt to help you write and test your program. It contains the following text: Python is an interpreted language and the python interpreter is a computer program that executes code written in the python programming language. The python interactive interpreter is useful for simple operations or programs consisting of only a few lines. For more lines, a programmer can write Python code in a file, and then provide that file to the interpreter. For normal development a programmer installs python as an application on a local computer. Macintosh and Linux operating systems usually include python, while Windows does not. Programmers can download the latest version of python for free from…Using Java: A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: the name of the client the service sold ( Dinner, Conference, Lodging) the amount of the sale the date of the event. Write a program that reads such a file and displays the total amount of each service category. Display an error if the file does not exist or the format is incorrect.
- PYTHON!!!!! 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 AM Enter the input file name: example.txt AM 3 I 3 SAM 3 The program should handle input files of varying length (lines). Program produces correct output given input, test 1 Test Case: Test program with example.txt Input: example.txt Results: AM 3 I 3 SAM 3 Program produces correct output given input, test 2 Test Case: Test program with test file 2 Input: test.txt Results: 3/4 1 98 1 AND 2 GUARANTEED 1 INDEED 1 PERCENT 1 SUCCEED 1 WILL 2 YES 1 YOU 2Design an application that can be used to read DVD titles from a text file. You do not have to write to the file, only write code to read the titles of DVDs from a text file called DVD.txtComputer Science Using Java language Write a procedure that generates a regular heightfield in data-files/model/heightfield.off with elevation given by the grayscale values of an image file. Use a file dialog to select the file, a number box to scale the xx and zz integer coordinates by, and a number box to set the scale that 1.0 corresponds to for height. Make a button labelled “Generate” that launches the generator. Display a message on screen while generating and then flush the G3D::ArticulatedModel cache, and reload the current scene on completion.
- Can you help me write a C++ Program that does the following: Create a program that reads a file containing a list of songs andprints the songs to the screen one at a time. After each song is printed,except for the last song, the program asks the user to press enter for more.After the last song, the program should say that this was the last song andquit. If there were no songs in the file to begin with, the program shouldsay that there are no songs to show and quit.The program should begin by asking the user for the name of the input file.Each song consists of a title, artist and year.In the file, each song is given on three consecutive lines.Create this program using the latest version of the class Song you created. The latest version of the class song I created is below: #include <iostream>#include <string>using namespace std;class Song {private: string Title; string Artist; int Year;public: Song() : Title("invalid"), Artist("invalid"), Year(-1) {} Song(const string…Task: Loading data from files This exercise will require you to load some information from files and use it in your program. scene.txt contains a description of a series of shapes and colours to draw. You need to write code to read in the file data and draw the requested shapes in the correct colour. Each line in scene.txt will contain one of the following starting keywords followed by some data: COLOUR followed by 3 values: R, G, B CIRCLE followed by 3 values: X, Y, RADIUS RECT Followed by 4 values: X, Y, W, H LINE Followed by 4 values: X1, Y1, X2, Y2 CIRCLES are defined from the center. RECT's are defined from the top left. All values are space separated, and you can assume all input is correct (no errors). Please solve this program to draw the scene. I can't upload the file scene.txt, so I decide to screenshot a file for you. Subject: Java ProgrammingwordCountDistinct.py: Write a program that reads words from a file (filename given as a command-line argument) and prints the number of distinct words. Words that differ only in case should be considered to be equivalent.For example, using the input: If there's a problem yo I'll solve itCheck out the hook while my DJ revolves itIce ice baby The program should print 18.
- Please 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 Data.txt I love my moneyCreate a file in your project named employees.txt with the following data (you can simply create the file by hand rather than with Python code): 123 Bob Smith345 Anne Jones256 Carol Lee845 Steve Robert Anderson132 Jill Thompson From your program's main function, give the user the following options: lookup a name based on ID number, lookup an ID number based on name, and quit the program. OPTION 1: The user chooses to lookup a name based on ID number: Use a try/except and ask the user to enter an integer. If they don't enter an integer, print an error message. If they do enter an integer, call a function named lookup_employee which takes the id as a parameter. If an employee with the given id number is found, return the name. Otherwise, return the string “Employee not found” Back in main, print the return result. OPTION 2: The user chooses to lookup an ID based on name: Ask the user to enter the first and last name (don't ask for the middle name). Call a function named…PLEASE COMMENT CODE In a python program, create a new file and call it “ tracking”. Write to it four lines each contains information about an order like this: 1-00654-021 Dell charger Toronto-WEST 99-49-ZAD011-76540-022 ASUS battery Milton-EAST 34-56-CBH561-09239-026 HP HD Scarborough-NORTH 12-98-AZC451-12349-029 Mac FD North York-LAWRENCE 34-49-ZWL01Add the file two more lines: 1-34567-055 Lenovo SSD Milton-ON 34-09-MT04 1-90432-091 Lenovo battery Oakville-ON 78-KL98 Define a function that searches for a brand (e.g. Dell, ASUS, etc.). Test the function in your program.