-3

I am a beginner, when it comes to PHP coding, and I have an assignment of,

'Create a text file (studentresult.txt) which will contain student id and their math score (out of 100) as follows:

S-6752 95

T-927 45

PT-08 56

F-7236 88

S-126 87

Now, you will write a php application (as below) which will load data from the mentioned text file. When the application will run, Average Score, How many students scored greater or equal to 80 will be shown. And there will be an input textbox, where user will enter student id and click Show Grade button, Grade letter (A+/B+/C+/F) of this student will be shown below. If student Id is not found, a message will be shown: “Student is not found”.'

pritty
  • 1
  • 1

1 Answers1

0

Follow the steps and do it your self:

1. Read txt file

How to read a file line by line in php

2. Calculate Avarage

$last_average = 100;
$total_numbers = 10;
$new_number = 54;

$new_average = (($last_average * $total_numbers) + $new_number) / ($total_number + 1);

Try something if there is any issue then ask community to help.

Govind Samrow
  • 9,981
  • 13
  • 53
  • 90