Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Having some difficulty writing code for this assignment, though I've seen some similar things here on Chegg. When I try to generate the 'p6.dat' file
Having some difficulty writing code for this assignment, though I've seen some similar things here on Chegg. When I try to generate the 'p6.dat' file on my PC, the only app that will read it is PSpice. Can I save it from Notepad using 'p6.txt'?
Write a program that will read data from the file "p6.dat". The file (that you will create) always contains 15 test scores (whole numbers between O and 100). The test scores are scores for 5 students taking 3 tests, and are arranged, in the file, by the student that is the first 3 numbers are the test scores for test 1, 2, and 3 for the first student, etc. The program will print: - average per student (5 averages), on a single line, with 2 decimals -average per test (3 averages), on a single line, with 2 decimals - overall best score on a single line how many scores were As (out of the 15, how many were at least 90) on a single line To simplify the code, no validations are needed. That is, assume the file is successfully opened, and that all data are 0-100, and that there are exactly 15 numbers in the file Note that the program reads the filename
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started