Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Student Gradebook PHP web application that records and displays student's names and grades. Requirements: Overview The application should include a student form to

Create a Student Gradebook PHP web application that records and displays student's names and grades.

Requirements:

  • Overview
    • The application should include a student form to enter a student's name and number grade.
    • The application should display the student names, number grades and letter grades.
  • Input
    • Create a form to input the student name and student grade (number grade) and a button to submit the form (2 text boxes and 1 button).
    • The student name is a string.
    • The student grade is a number (from 0 - 100).
    • Validate that the form fields are entered correctly.
  • Processing
    • Store students information in an array.
    • Prepopulate the student array with 4 students.
    • When the submit button is pressed,
      • either add the new student (name and grade) to the end of the array
      • or update the existing student grade in the array.
    • Calculate an adjusted grade for each student by adding 10%.
    • Convert the number grade to a letter grade as follows.
      • returns 'A' if grade is greater than or equaled to 90
      • returns 'B' if grade is in the range of 80 through 89
      • returns 'C' if grade is in the range of 70 through 79
      • returns 'D' if grade is in the range of 60 through 69
      • returns 'F' if grade is less 60
  • Output
    • The student display should show all of the students in the array.
    • So the display will always show the 4 students that were prepopulated.
    • Then the display will also show any student that is added using the student form.
    • The student display should show the following in an HTML table format, one row per student with the following fields on each row.
      • the student name
      • the original student grade (number grade)
      • the letter grade for the original grade
      • the adjusted student grade (number grade)
      • the letter grade for the adjusted grade
    • Display the number of students.
    • Add up all of the student original grades and display the total.
    • Calculate the average of the student original grades and display the average.
    • Display a var_dump of the student array (for debugging).
  • Hint:
    • You may use the sort.php (Script 7.5) code as an example for the student array.
    • Sorting is not necessary but maybe included if you'd like.
    • Since the student list is not being saved between requests, it will reset each time the form is submitted.
    • My Little Gradebook

      // Address error management, if you want.

      // Create the array: $grades = [ 'Richard' => 95, 'Sherwood' => 82, 'Toni' => 98, 'Franz' => 87, 'Melissa' => 75, 'Roddy' => 85 ];

      // Print the original array: print '

      Originally the array looks like this: '; foreach ($grades as $student => $grade) { print "$student: $grade "; } print '

      ';

      // Sort by value in reverse order, then print again: arsort($grades); print '

      After sorting the array by value using arsort(), the array looks like this: '; foreach ($grades as $student => $grade) { print "$student: $grade "; } print '

      ';

      // Sort by key, then print again: ksort($grades); print '

      After sorting the array by key using ksort(), the array looks like this: '; foreach ($grades as $student => $grade) { print "$student: $grade "; } print '

      ';

      ?>

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

More Books

Students also viewed these Databases questions

Question

Use service tiering to manage the customer base and build loyalty.

Answered: 1 week ago