You are provided with an input file ("Data.txt") containing a number of text lines. Each line contains a record of a supposed triangle. Each record has four attributes: record number, three sides values. The record number and the sides are separated by :' while the three attributes are separated by one space. Figure 1 shows a sample input file. You are asked to write a Python program that reads the content of the input file, checks whether the sides form a triangle or not. When the sides form a triangle, finds out its type ('Equilateral' or "Not Equilateral' then computes its perimeter (P) and its area (A). There will be three cases according sides values: > Equilateral triangle if all sides are cqual (S = Si = S2 = Si). Then compute the perimeter (P) and area (A) of triangle as follows: P= 35 ; A =s
Q: Using a text editor, create a file that contains a list of at least 15 six-digit account numbers.…
A: /File: ValidateCheckDigits.java import java.io.BufferedWriter; import java.io.File; import…
Q: Write a program that prompts the user to input the name of a text file and then outputs the number…
A: Coded using C++.
Q: Write a program that reads the-zen-of-python.txt and writes each line to UpdatedZen.txt, a new text…
A: import sys# files infile = Noneoutfile = Nonetry: # try to open infile =…
Q: Re-write the program of Question #3 using data files. The input data numbers.txt contains (positive)…
A: C++ program for Question 4 : #include <iostream> #include <fstream> using namespace…
Q: Write a Python program that reads from each line of an input file called grades.txt, a student id…
A: Actually, python is a easiest programming language. It is a dynamically typed language.
Q: Once the modelling has been run, the user should have the option to rerun it. Each time it is run,…
A: One activates some authority: Unless there are connections, I've learned that this just —until…
Q: Write a Program that reads integers from a file called "input.dat" (Figure 1) that contains unknown…
A: As no programming language is mentioned, it is solved using basic C++
Q: Create a program that calculates the average test scores. Given the student’s name and five test…
A: Problem Statement: Create a program that calculates the average test scores. The data is input from…
Q: We provide two files which are boys.txt and girls.txt. These are blank-delimited files where the…
A: code is given below boynames.txt james 123kane 456robert 1200semmy 775 girlname.txt martina…
Q: Using matplotlib, a Python program that reads the contents of the file see attached then plots the…
A: Purpose of the solution: This program will generate a line chart whose data values will be obtained…
Q: WHATS THE ALGORITHIM FOR THIS The course records are shown below: Each student has 4…
A: Introduction: WHAT IS THE ALGORITHM FOR THIS The course records are shown below: Each student has…
Q: Modify your program from Learning Journal Unit 7 to read dictionary items from a file and write the…
A: Answer is given below .
Q: (a) Write a program to read data from a file data.txt and the program would create a file meta.txt…
A: As no programming language is mentioned, it is solved using Python
Q: Using Java, Write a program that reads an input file and writes an output file inserted using…
A: Here I written Java Code with File I/O for given problem below. I hope you like it.
Q: Using a text editor, create a file that contains a list of at least 15 six-digit account numbers.…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a program that generates 10 random doubles, all between 1 and 11, and writes them to a text…
A: In the first program – Create an object for a file. Take an array of double type. Open a file using…
Q: Write a C++ program that opens three files (i.e. s1.txt, s2.txt, and s3.txt) and reads the data of…
A: #include<iostream> #include<fstream> #include<conio.h> using namespace std; int…
Q: Write a program to read the names and marks of students from the text file "students.txt". and saves…
A: The required C program code is given below: #include <stdio.h> #include <stdlib.h> int…
Q: Write a python program, that takes three strings as input parameters. The function reads all the…
A: The code in python is given below with an sample output.
Q: Write a Python program that calculates the area and the circumferenceof a circle whose radius is…
A: Required: Write a Python program that calculates the area and the circumferenceof a circle whose…
Q: Write a program which reads from a file all digits and prints the largest number which is a multiple…
A: A number is said to be a multiple or factor of a number if the number is divisible by the multiple…
Q: Write a complete lython program that prompts the user for his/her full name. Regardless of the user…
A: Please find the answer below :
Q: Task 1 Write a python program that reads the first n lines of a text file. Suppose you have a file…
A: Assume that, already there is a with name test.txt is present which is an empty file. So, first in…
Q: Write a program (mileage.py) that reads gallons and miles from input file “mileage.txt" and compute…
A: Here I have open the given file in the read mode and another file in write mode to write the final…
Q: I am trying to write a program in PYTHON that will open a file named StudyHours.txt. The program…
A: Code: #step variable to iterate every third step of filestep = 3#open file StudyHours.txt in read…
Q: Write a program to write a pattern into a new file (result.txt) as shown below (6 rows of "*" ), the…
A: The solution to the given problem is below. **Note: As programing language is not mentioned in the…
Q: In this assignment, you are to implement the Digital Signature Algorithm (DSA) as described in the…
A: Given:
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 to read the file "input.txt", which contains one student's name for one line, such…
A:
Q: Write a program that reads two input files whose lines are ordered by a key data field. Your program…
A: required: Write a program that reads two input files whose lines are ordered by a key data field.…
Q: Write a C(not C++) program that reads the exam data for each student from a file named grades.txt.…
A: Place the adequate header files. Declare necessary variables. Open the grades.txt file in read mode.…
Q: sum of the will have an orthogonal triangle input from a file and you need to find the max numbers…
A: Code : #function to check number is prime or nor def isPrime(num): flag = True if num > 1:…
Q: Task. Your task is to develop a python program that reads input from text file and finds if the…
A: letter_comb = ['A', 'AA', 'AB', 'AD', 'AR', 'AM', 'AW', 'AY', 'B', 'BA', 'BB', 'BD', 'BR', 'BM',…
Q: Write a program to compute Letter grades for a course. The course records are in a file that will…
A: Step 1 : Start Step 2 : Take user input for the grading system for the Scores of the students. Step…
Q: Using only Unix system calls(like open, seek(), tell, etc.), write a C program to reverse the order…
A: Program #include <stdio.h>#include <stdlib.h>#include <string.h> void…
Q: Python program to read a filename lines.py and displays the contents of the file with line number
A: Program: # Python version 3# the main functiondef main(): # define the content to write in the…
Q: n this assignment, you are to take in input from two files: one file containing a list of five first…
A: Given below is the code and sample input files. You can test with your own files. input file:…
Q: Re-write the program of Question #3 using data files. The input data numbers.txt contains (positive)…
A: The given problem is to use the given program and write a new code that instead of readin input from…
Q: Write a C++ program that prompts the user to enter a file name that contains the scores of students…
A: Following points are important for reading the marks.txt file and finding the maximum and minimum…
Q: Scenario You are required to tally the results of a small football competition. Based on an input…
A:
Q: Suppose you are given a text file that contains the names of people. Every name in the file consists…
A: Program Approach: Import necessary packages for reading files and writing files ,collections .…
Q: Write a program to compare two files, printing the first line where they differ.
A: C program to compare two files and report differ We've been given virtually identical files.…
Q: In Math, an equilateral triangle is a triangle in which all three sides are equal. You are provided…
A: Create the input file: Data.txt 1:4.5 5.5 6.5552:0 4.56 2.93:6.982 7.53 8.44:2.5 2.5 2.55:-3.0…
Q: Write a C++ program that prompts the user to enter a file name that contains the scores of students…
A: Note: We are authorized to answer one question at a time, since you have mentioned 1, 2, and 3…
Q: Write a program that inputs a filename from the user and prints to the terminal a report of the…
A:
Q: Write in Python: Given a set of text files containing synonyms for different words, complete the…
A: To run given program correctly, you need to create 2 files check.py // you can give any name for .py…
Q: Write a program that asks the user for the name of a text file, and then prints to the screen each…
A: PROGRAM: #Defining main() def main(): #Getting file name as input from the user fileName =…
Q: Suppose you are given a text file "students.txt" that contains the data of students. Every line in…
A: Notes: 1) There were no restriction stated hence I have made this way. 2) There were no mentioned of…
Q: Implement a program that is able to read in a set of numbers from a file input.csv and compute the…
A: GIVEN: Implement a program that is able to read in a set of numbers from a file input.csv and…
please use spyder
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
- In Python Write a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Ex: If the input of the program is: movies.csv and the contents…In this project, you will develop algorithms that find road routes through the bridges to travel between islands. The input is a text file containing data about the given map. Each file begins with the number of rows and columns in the map considered as maximum latitudes and maximum longitudes respectively on the map. The character "X" in the file represents the water that means if a cell contains "X" then the traveler is not allowed to occupy that cell as this car is not drivable on water. The character "0" in the file represents the road connected island. That means if a cell contains "0" then the traveler is allowed to occupy that cell as this car can drive on roads. The traveler starts at the island located at latitude = 0 and longitude = 0 (i.e., (0,0)) in the upper left corner, and the goal is to drive to the island located at (MaxLattitude-1, MaxLongitudes-1) in the lower right corner. A legal move from an island is to move left, right, up, or down to an immediately adjacent…In this project, you will develop algorithms that find road routes through the bridges to travel between islands. The input is a text file containing data about the given map. Each file begins with the number of rows and columns in the map considered as maximum latitudes and maximum longitudes respectively on the map. The character "X" in the file represents the water that means if a cell contains "X" then the traveler is not allowed to occupy that cell as this car is not drivable on water. The character "0" in the file represents the road connected island. That means if a cell contains "0" then the traveler is allowed to occupy that cell as this car can drive on roads. The traveler starts at the island located at latitude = 0 and longitude = 0 (i.e., (0,0)) in the upper left corner, and the goal is to drive to the island located at (MaxLattitude-1, MaxLongitudes-1) in the lower right corner. A legal move from an island is to move left, right, up, or down to an immediately adjacent…
- A file has r=20000 STUDENT records of fixed-length. Each record has the following fields: NAME (30 bytes), SSN (10 bytes), ADDRESS (40 bytes), PHONE (9 bytes), BIRTHDATE (8 bytes), SEX (1 byte), MAJORDEPTCODE (4 bytes), MINORDEPTCODE (4 bytes), CLASSCODE (4 bytes, integer), and DEGREEPROGRAM (3 bytes). Suppose the block size is 512 bytes. (a) Calculate the record size R in bytes. (b) Calculate the blocking factor (number of tuples per block) and the number of blocks required. (c) Calculate the average block accesses it takes to find a record by doing a linear search on the file. (d) Assume the file is ordered by SSN; calculate the block accesses takes to search for a record given its SSN value by doing a binary search.DescriptionWrite a program to compute average grades for a course. The course records are in a single file and are organized according to the following format: each line contains a student's first name, then one space, then the student's last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program will read data from this file and write its output to a second file. The date in the output file will be nearly the same as the data in the input file except that you will print the names as last-name, first-name; each quiz score, and there will be one additional number at the end of each line:the average of the student's ten quiz scores.Both files are parameters. You can access the name of the input file with argv[1]. and the name of the output file with argv[2].The output file must be formatted as described below: 1. First and last names…PYTHON: 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. 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, and letter grades of the students into a text file named report.txt. Output one student per row…
- In Java Write a program that reads the student information from a tab separated values (tsv) file and creates a text file that contains student information together with 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. The program performs the following tasks: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt. Output one student per row and separate the values with a tab character. Ex: If the input of the program is: StudentInfo.tsv and the contents of StudentInfo.tsv are: Barrett Edan 70 45 59 Bradshaw Reagan 96 97 88 Charlton Caius 73 94 80 Mayo Tyrese 88 61 36 Stern Brenda 90 86 45…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 ExampleA temperature file consists of five records, each containing a temperature in degrees Fahrenheit. A program is to be written that will read the input temperature, convert it from degrees Fahrenheit to degrees Celsius and print both temperatures in two columns on a report. Column headings, which read ‘Degrees F’ and ‘Degrees C’, are to be printed at the top of the page. What ist he best solution algorithm to successfully implement the above question?
- We’ve been updating and extending the inventory project to use files and to use arrays. Now it’s time to put it all together. I will give you a file inventory.txt File Contents: Red delicious apples 1.00 25 6 8 10 Assorted bouquets 4.00 50 10 10 0 Camembert cheese 2.00 25 10 12 4 END The file will have the following specifications: Each record consists of two lines. The first line contains the name of the product, which may be more than one word long. The second line contains the wholesale price as a decimal, the markup as a percentage, and three quantities, for counter, shelf, and warehouse. If the first line of a record contains the word END all by itself, that is the end of the file. Your task is to read each record into the program, as a string for the name, and numbers for the price and markup, and as an array of numbers for the quantities. Then calculate the total profit for each item: (wholesale price) * (markup, converted into a decimal) * (total quantity). Print out a report…Write a program that reads movie data from a csv (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the csv file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator (|) in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the csv file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Ex: If the input of the program is: movies.csv and the contents of movies.csv…Write a program that reads movie data from a csv (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the csv file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator (|) in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the csv file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Ex: If the input of the program is: movies.csv and the contents of movies.csv…