A file named Description.txt contains unknown number of metal sheets dimensions and description (maximum no. of records is 30). Each line in the file consists of Metal sheet name (string), width (float), length (float) and height (float). Write a program that reads the data from the file into 4 parallel arrays. Your program should calculate and display the following (see screen output): The number of Metal sheets in the file. The average length for all metal sheets. Metal sheets information (Metal sheet name and volume) for all items in the file. The volume is equal to width x length x height. The metal sheet name with smallest volume.
Q: Write a program to create two files with the names file4.txt and file4a.txt two 10 element int…
A: Given:- Write a program to createtwo files with the names file4.txt and file4a.txt two 10 element…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using the adequate header files. Declare the necessary integer type and character type arrays.…
Q: The local driver’s license office has asked you to create an application that grades the written…
A: Procedure Followed: Include header file. Start main method. Declare variables: exam_answers: array…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Q: Write a program that displays the contents of a file in four columns titled “Item Name”, “Num of…
A: A C++ program is as follows, #include <iostream> #include <fstream> #include…
Q: 3. Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
A: Algorithm : MaxMin function : Step 1 : declare and initialize the variables. Step 2 : open the…
Q: in vaccine.txt it search how many vaccine are available. in dist.txt we have to import vaccines…
A: Our task is to crate the working code in which we have covered all the requirement and prerequisites…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: An array is a linear data structure where the elements occupy contiguous locations in memory. All…
Q: Problem: Write a program that prompts the user to enter 10 names, each with maximum of 30…
A: GIVEN CODE: //Start of program #include <iostream>//Line 1// #include <cstring>//Line…
Q: The file, Program11.txt, on the I: drive contains a chronological list of the World Series’ winning…
A: def read_file(): # Open file to read in read mode program11file = open('Program11.txt', 'r')…
Q: The manager of a football stadium wants you to write a program that calculates the total ticket…
A: #include <iostream>#include <fstream>#include <iomanip> using namespace std; int…
Q: Write a program that uses 3 command line arguments to search a list of float numbers in a file and…
A: Step 1 : Start Step 2 : Create a method SearchFile which takes the file name and the float value to…
Q: studentNumber (int), courseCode (char array [8]), finalGrade (float). 200201078 CENG104 89.75…
A: Declare an integer variable to store user input for options from 0 to 6. Declare variables to hold…
Q: 6. Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
A: Required:
Q: For this programming exercise you will use the text file named “USPopulation.txt” that is located on…
A: Program:- #include<iostream>#include<fstream>using namespace std; int main() { int…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Program Plan Using the adequate header files. Declare the necessary integer type and character…
Q: A file named history.txt contains unknown number of car records (maximum no. of records is 50). Each…
A: // iostream in C++ is the standard library which implement stream based input/output capabilities…
Q: Write a program that calculate GST (Goods and Services Tax) for some electronic products.…
A: Program to calculate the GST on electronic products. Store the name of the products in the array…
Q: In this assignment you will write a program to find the mean of a list of grades stored in a file.…
A: Required: In this assignment you will write a program to find the mean of a list of grades stored in…
Q: Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Q: Fix the following m file: Submit fixed m file and histogram jpg created…
A: % Compute the average of some temperature data % Then plot the data in a MATLAB plot window %…
Q: Submission: Combine the code files for Q1 and Q2 as a zip file and submit in Moodle Question 1:…
A: Below I have provided a java Program for the given question. Also, I have attached a screenshot of…
Q: A file named Description.txt contains unknown number of metal sheets dimensions and description…
A: The given is the problem where the details of the metals to be read out from the given file named…
Q: In this lab, you will read two files. Firstly, the ‘AccountData.csv’ file has the name and account…
A: Given In this lab, you will read two files. Firstly, the ‘AccountData.csv’ file has the name and…
Q: Required: The program must read from the above file and must load the name, surname and mark into…
A: Objective: This program reads a text file of four students and loads the details into three arrays.…
Q: Problem: Write a Python program that reads from an input file named employees.txt some employee…
A: Using python 2.7 def printHeader():print…
Q: and output txt file name. The input text file will have exactly 10 lines. Each line will have: 1-…
A: Actually, array is a collection of elements.
Q: In this assignment you will write a program to find the mean of a list of grades stored in a file.…
A: We have to create a program which reads the data of the text file named "john_smith_grades.txt" and…
Q: file contains a list of telephone number in following form. Aman 23456 Raj…
A: Note: We are authorized to answer one problem at a time since you have not mentioned which one you…
Q: Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes…
A: Given: Assume that a file contains students’ ids, full names, and their scores (Assignments grade,…
Q: Rewrite the code in Figure 8-93 to read each line of a text file into an array named strFordModel.…
A: Do While objectReader.Peek <> -1 'As long as there is data in the reader object.'strFordModel…
Q: A file contains a list of telephone number in following form. Aman 23456 Raj…
A: #include <bits/stdc++.h>using namespace std;int main(){ fstream my_file;…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Q: Use the Active Code window below to create 4 parallel arrays and intialize them using initialization…
A: Answer is given below .
Q: #include #include struct info{ char names[100]; int age; float wage; }; int main(int argc, char*…
A: C programming is a general-purpose, procedural, imperative computer programming language developed…
Q: A vehicle inspection station keeps records of its checking services in a text "inspection.txt").…
A: Below is the implementation:-
Q: A file named Description.txt contains unknown number of metal sheets dimensions and description…
A: Program code: #include<bits/stdc++.h> #include <fstream>#include <sstream>#include…
Q: In the student sample program files for this chapter, you will find a text file named…
A: Code : HousePrice.cs File: namespace HousePriceAnalysis { class HousePrice { //…
Q: Write a function that reads all the numbers from a file into an array. The file is already open…
A: The function readData takes into parameters: an ifstream file already opened, an array of double to…
Q: (a) Write a C function readNums() that takes a filename and an integer array, reads the integer…
A: // Declaring header files#include <stdio.h>#define MAX 1000 // Function to read numbersint…
Q: Write a program in C++ to do the following: 2. Create an array to hold up to 20 integers. 3.…
A: A required program is as follows, #include <iostream> #include <string> #include…
Q: Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes…
A: Program Approach:- Using the header files. Using the struct keyword. Main function Storing…
Q: Write a program that asks for user's name, phone number and address. The program then saves all…
A: Step 1 : include fstream and string file and iostream file Step 2 : create 3 variables of string…
Q: Write a program that calculate GST (Goods and Services Tax) for some electronic products.…
A: code: #include<iostream> using namespace std; int main() { //variable declaration int choice;…
Q: n Dist.txt it will add vaccine in storage like how many vaccines are needed and from where is coming…
A: Given: Program have in c . we have to added a find function in this . it will take vaccine code to…
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Algorithm/Approach: Using necessary header files. Declare integer type and character type arrays.…
Q: write a function called fillArrayFromFile that will read numbers from a file that contains one…
A: Since the language is not mentioned, I have coded this in C language. Follow the code below
Q: Assume that a file contains students' ids, full names, and their scores (Assignments grade, quizzes…
A: Using necessary header files. Declare integer type and character type arrays. Prompt the user for…
Q: A file contains a list of telephone number in following form. Aman 23456 Raj…
A: Note: We’ll answer the first question since the exact one wasn’t specified. Please submit a new…
Step by step
Solved in 3 steps with 2 images
- Given 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 arrays, 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. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads 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 Drinks Water…Given 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 arrays, 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. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads 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 Drinks Water…All code in JAVASCRIPT Write a program that creates two files with the names file4 and file4a two 10 element int arrays with the names arrfile4 and arrfile4a; these arrays are to have different values write the contents of arrfile4 to file4write the contents of arrfile4a to file4a
- Write a program that expands on the program below (i.e. reading data of each record in the file and storing it into data structure). The expansion involves writing all records to a file (use fprintf, call the name of the file csv). The displayed data must be accessed (and thus written) from data structure (i.e. array of structs). The format written to the file should be one line per record, with each field separated by a comma (‘,’) program should then output the number of lines in the file.test the program by creating a text file with at least 10 lines of text (of any composition). Use notepad++ to create the data file. #include<stdio.h>#include<stdlib.h> //Structurestruct Person{ char name[10];int age;float wage; }; //Main int main (int argc, char **argv) { FILE* f; if (argc != 2) { printf("No filename in the argument"); return 1; } f = fopen(argv[1], "r"); if (f == NULL) { printf("The file cannot be opened successfully:…Computer Science Write a program that uses 3 command line arguments to search a list of float numbers in a file and prints out the result of whether the number was found or not on the console. Also, it prints the array in the reverse order (not sorted but reverse order of how the numbers were read in). The first argument is the name of the input file which has the numbers to be searched, the second is an integer specifying how many numbers are in the input file and the third argument is the float number being searched for. Use dynamic memory allocation for the array and use a function (that returns a boolean value) to do the searching. Also make sure in the beginning of your program, that the program will execute only if exactly three arguments (other than executable name itself) are specified. at the command line.The name of the C++ file must be YourIslandID_searching.cpp Write a program that defines and initializes a one-dimensional array of 30 integers. The numbers to be initialized for array are given below: 101 125 32 73 7 10 54 69 150 43 111 25 107 19 27 133 13 88 97 5 65 2 117 30 61 99 109 146 77 81 (a) Your program should prompt the user for a target value (or Key). Pass the value, the array, and the size of the array to a function that uses the linear or sequential search algorithm. The function should keep a count of the number of comparisons it makes until it finds the value. This function will return the number of comparisons to main function. (b) The program should then call a function that uses bubble sort algorithm to sort the given array. (c) The program then should call a function that uses the binary search algorithm to locate the same target value (or Key). Pass the value, the sorted array, and the size of the array to this function. It should also keep count of the number of…
- Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes grade,Midterm grade, Practical exam grade, and final exam grade) (each column is separated by $). You arerequired to write a C program to do the following: Using the concept of parallel arrays create records for students with above attributes (id, full name,score).(you are not allowed to use structure) Ask the user to enter the input file name and read it (suppose that, there are different files youcould read data from). Read the data from the file and store it in record for students, which hasIDs, Names, and Scores. The IDs should be declared as integers, the Names as a two-dimensionalarray of characters and the Scores as doubles. Assume that the maximum length of full name ofany student is 50 characters. Also, you may assume that there will be No more than a 1000 studentrecords in the file. Calculate the final grade as the flowing:Grade= (Assignment)*15%+(Quizzes) *15%+(Midterm…Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes grade,Midterm grade, Practical exam grade, and final exam grade) (each column is separated by $). You arerequired to write a C program to do the following: Using the concept of parallel arrays create records for students with above attributes (id, full name,score).(you are not allowed to use structure) Ask the user to enter the input file name and read it (suppose that, there are different files youcould read data from). Read the data from the file and store it in record for students, which hasIDs, Names, and Scores. The IDs should be declared as integers, the Names as a two-dimensionalarray of characters and the Scores as doubles. Assume that the maximum length of full name ofany student is 50 characters. Also, you may assume that there will be No more than a 1000 studentrecords in the file. Calculate the final grade as the flowing:Grade= (Assignment)*15%+(Quizzes) *15%+(Midterm…Assume that a file contains students’ ids, full names, and their scores (Assignments grade, quizzes grade,Midterm grade, Practical exam grade, and final exam grade) (each column is separated by $). You arerequired to write a C program to do the following: Using the concept of parallel arrays create records for students with above attributes (id, full name,score).(you are not allowed to use structure) Ask the user to enter the input file name and read it (suppose that, there are different files youcould read data from). Read the data from the file and store it in record for students, which hasIDs, Names, and Scores. The IDs should be declared as integers, the Names as a two-dimensionalarray of characters and the Scores as doubles. Assume that the maximum length of full name ofany student is 50 characters. Also, you may assume that there will be No more than a 1000 studentrecords in the file. Calculate the final grade as the flowing:Grade= (Assignment)*15%+(Quizzes) *15%+(Midterm…
- In Python: The Broadway dataset contains data for Broadway shows' Capacity (percentage of the theatre filled) and Gross Potential (maximum amount that can be earned) for multiple shows in a specific month and year. Given a CSV file name read from user input, write a program that performs the following tasks: Read in the CSV file as a dataframe. Insert a new column labelled "Size" at the end of the dataframe. The "Size" column contains values in column "Gross Potential" divided by 2. Output the dataframe using the print() function. Create a scatter plot of "Gross Potential" vs "Capacity" with the following marker styling parameters: markers: 'x' color: orange size: values in column "Size" Add the x-label ("Capacity", fontsize = 10), y-label ("Gross Potential", fontsize = 10), and title ("Gross Potential vs Capacity", fontsize = 16) to the figure. Add gridlines to the figure using '--' as linestyle. Save the figure as output_fig.png. Click here to view Input and Output ExampleThis is the statement it gives - Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. Assume also the last names and first names do not contain whitespaces. The program performs the following tasks: Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores,…1. a) Write a program to create two files with the names file4.txt and file4a.txt two 10 element int arrays with the names arrfile4 and arrfile4a; these arrays are to have different values write the contents of arrfile4 to file4.txt write the contents of arrfile4a to file4a.txt b. Modify exampleFour to read integer values from the keyboard, store them into a 15 element array, then write the array into a file named userin.txt exampleFour In the while loop, this program reads fileLoop.txt until all items are read; Each item in the file is stored into an array package storeintoarr; import java.util.Scanner; import java.io.*; public class Storeintoarr { public static void main(String[] args) throws IOException { File loopfile = new File("fileLoop.txt"); Scanner getAll = new Scanner( loopfile ); // connect a Scanner to the file int num = 0, square = 0; int[] items = new int[10]; int i = 0;…