Must be done in python and using linux mint
----------------------------Part1------------------------
filename = input('Enter file name : ')
# open file in write mode
fptr = open(filename, 'w')
print('Enter the scores, enter -1 to quit:')
# infinite loop
while True:
score = int(input(''))
if score == -1:
break
# write into the file
fptr.write(str(score) + '\n')
-----------------------------Part2------------------------------
filename = input('Enter file name : ')
# open file in read mode
fptr = open(filename, 'r')
# read the content of file
x = fptr.read()
arr = []
# read file line by line
for y in x.split('\n'):
arr.append( int( y ) )
largest = arr[0]
smallest = arr[0]
sum = arr[0]
for i in range( 1 , len(arr) ):
if arr[i] > largest:
largest = arr[i]
if arr[i] < smallest:
smallest = arr[i]
sum += arr[i]
average = sum / len(arr)
print('Largest Score :', largest)
print('Smallest Score :', smallest)
print('Average Score :', average)
l = int(input('\nEnter the lower limit: '))
u = int(input('Enter the upper limit: '))
for i in arr:
if i >= l and i <= u:
print(i)
--------------------------scores1.txt----------------------
100
79
67
32
79
85
97
41
Sample Output
Must be done in python and using linux mint Write a program to create a text...
This will be done using Python in Linux Mint. The program should include a comment block at the top with your name, the program number, and the name of the course. (Make sure to have the file that does have the extension .py) How to run the file in Linux Mint? Open a command prompt (e.g. terminal) Make sure you are in the directory where your file is saved (e.g. type "cd ~/Desktop" if your file is on...
Topics: list, file input/output (Python) You will write a program that allows the user to read grade data from a text file, view computed statistical values based on the data, and to save the computed statistics to a text file. You will use a list to store the data read in, and for computing the statistics. You must use functions. The data: The user has the option to load a data file. The data consists of integer values representing student...
In this assignment, you will write a program in C++ which uses files and nested loops to create a file from the quiz grades entered by the user, then reads the grades from the file and calculates each student’s average grade and the average quiz grade for the class. Each student takes 6 quizzes (unknown number of students). Use a nested loop to write each student’s quiz grades to a file. Then read the data from the file in order...
Must be done in C# please! Thanks! In this assignment you will create a program named Test Scores that displays the average of all tests; average midterm score; average final score; and displays the midterm or final score of a particular student. Create a class level two dimensional integer array named Grades initialized with the following data: 897 242 301 987 116 450 865 128 992 109 88 75 94 70 90 87 81 79 97 79 78 80 92...
CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes the user and displays the purpose of the program. It then prompts the user to enter the name of an input file (such as scores.txt). Assume the file contains the scores of the final exams; each score is preceded by a 5 characters student id. Create the input file: copy and paste the following data into a new text file named scores.txt DH232 89...
***This program is to be created using PyCharm Pro*** 1. Print “This program manipulates text from files and the clipboard and performs other string, file, and directory manipulation tasks.” 2. Output the current working directory of the program. 3. Ask the user to enter the directory where they would like files to be stored, make that directory, and store files in the program in that directory. 4. Write the following three lines to file_one.txt (without bullet points): • Line 1...
Following should be done in C++: Create a program that reads a text file and prints out the contents of the file but with all letters converted to uppercase. The name of the file to be read by the program will be provided by the user. Here are some example session: Contents of "data.txt": Hello, World! User input: data.txt Program output: HELLO, WORLD! Contents of "data.txt": tHiS FiLe HaS mIxEd CaSeS User input: data.txt Program output: THIS FILE HAS MIXED...
***This program is to be created using PyCharm Pro*** 1. Print “This program manipulates text from files and the clipboard and performs other string, file, and directory manipulation tasks.” 2. Output the current working directory of the program. 3. Ask the user to enter the directory where they would like files to be stored, make that directory, and store files in the program in that directory. 4. Write the following three lines to file_one.txt (without bullet points): • Line 1...
The purpose of this assignment is to get experience with an array, do while loop and read and write file operations. Your goal is to create a program that reads the exam.txt file with 10 scores. After that, the user can select from a 4 choice menu that handles the user’s choices as described in the details below. The program should display the menu until the user selects the menu option quit. The project requirements: It is an important part...
Write a program named ClassifyScores that classifies a series of scores entered by the user into ranges (0-9, 10-19, and so forth). The scores will be numbers between 0 and 100. Design and implement a program to prompt the user to enter each score separately. If the score is within the correct range, then increment the appropriate range If the score entered is greater than 100, display an error message, ignore the incorrect score, and prompt for the user to...