Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an input file called indata.txt that has the following data: David Smith 8 9 9 0 9 2 Amy Davidson 7 8 5 6

Create an input file called indata.txt that has the following data:
David Smith 899092
Amy Davidson 785623
Jenny Akers 757967
David Lopez 888079
The file shows first and last name of four students in a class. The next 3 numbers
are scores from three different tests that were out of 100. You need to find the
average of these three scores and then use the average to find the grade for the
student based on this table.
Average Score Grade
90100 A
8089 B
7079 C
6069 D
059 F
You should write the information read from the input file to an output file called
grades.txt. You may also write data to the screen.
In addition, add average score then followed by the grade.
Hence, for the input file given above, the output file should be like this.
David Smith 89909290.3 A
Amy Davidson 78562352.3 F
Jenny Akers 75796773.6 C
David Lopez 88807982.3 B
Use functions in your program if you can. Otherwise, it will be fine in this program
to find the solution without using any functions.
Add pre-conditions and post-conditions documentation to your function.
You may use same test values shown above.
Remember to use meaningful names for your variables.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions