This code should be written in php.
Write a program that allows the user to input a student's last name, along with that student's grades in English, History, Math, Science, and Geography.
When the user submits this information, store it in an
associative array, like this:
Smith=61 67 75 80 72
where the key is the student's last name, and the grades are
combined into a single space-delimited string.
Return the user back to the data entry screen, to allow more student names and grades to be entered.
When the user has completed grade entry for all students, allow him/her to generate a grade report. This report should output a table to the screen with a row for each user, and a column for each grade. Failing grades (less than 60) should be printed in red.
Hint: When creating the report, loop through the associative array. Use the split() function to parse the grade string for each student into its own temporary array, that can be looped through to output that student's grades.
Explanation :
The Index File allows the user to enter the Values and gives the values to test.php File. Now, the Grade Report is generated and the Conditions are satisfied here.
Code :
index.html file :
<!DOCTYPE HTML>
<html>
<body>
<form action="test.php"
method="POST">
Enter Last Name
: <input type="text" name="lname"><br>
English Marks :
<input type="text" name="eng"><br>
History Marks :
<input type="text" name="hist"><br>
Math Marks :
<input type="text" name="math"><br>
Science Marks :
<input type="text" name="sci"><br>
Geography Marks
: <input type="text" name="geo"><br>
<input
type="submit">
</form>
</body>
</html>
test.php file :
<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial,
sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
</style>
</head>
<body>
<h1>Grade Report</h1>
<?php
function
getProperColor($var)
{
if ($var <
60) return '#FF0000';
else return
'#FFFFFF';
}
?>
<table>
<tr>
<th>Last
Name</th>
<th>English</th>
<th>History</th>
<th>Mathematics</th>
<th>Science</th>
<th>Geography</th>
</tr>
<tr>
<td><?php echo
$_POST["lname"];?></td>
<td style="background-color:
<?php $color = getProperColor($_POST['eng']); echo $color;
?>"> <?php echo $_POST["eng"];?></td>
<td style="background-color:
<?php $color = getProperColor($_POST['hist']); echo $color;
?>"> <?php echo $_POST["hist"];?></td>
<td style="background-color:
<?php $color = getProperColor($_POST['math']); echo $color;
?>"> <?php echo $_POST["math"];?></td>
<td style="background-color:
<?php $color = getProperColor($_POST['sci']); echo $color;
?>"> <?php echo $_POST["sci"];?></td>
<td style="background-color:
<?php $color = getProperColor($_POST['geo']); echo $color;
?>"> <?php echo $_POST["geo"];?></td>
</tr>
</table>
</body>
</html>
This code should be written in php. Write a program that allows the user to input...
using C# Write a program which calculates student grades for multiple assignments as well as the per-assignment average. The user should first input the total number of assignments. Then, the user should enter the name of a student as well as a grade for each assignment. After entering the student the user should be asked to enter "Y" if there are more students to enter or "N" if there is not ("N" by default). The user should be able to...
in c++ A: Write a program which ask user to enter 10 student's name and their grades. Then find the average of all the grades. Output all the grades with student name of whom got the grade over the average.
In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a test grade (integer value) for each student in a class. Validation Tests are graded on a 100 point scale with a 5 point bonus question. So a valid grade should be 0 through 105, inclusive. Processing Your program should work for any...
Need a PHP code that has a box to type in that allows the user to put the information through the PHP site to the database for the following categories: INT, First name, Last name, Sex. Once injected it needs to echo to the page to show the table of all entries. The code below is how far I got with it. MySQL: add a row and query $link = mysql_connect('stewcraw.dotstermysql.com', 'prof', '3632password'); if (!$link) { die('Could not connect: '...
PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do one of five things at a time: 1. Add students to database. • There should be no duplicate students. If student already exists, do not add the data again; print a message informing student already exists in database. • Enter name, age, and address. 2. Search for students in the database by name. • User enters student name to search • Show student name,...
Write a web program to allow the user to sort a list of things. Use HTML and PHP. Your input (HTML) should include a text area the user can type in their list. The output (PHP) should be in the form of a table. Use the explode command to break the input up into an array. $list=explode(PHP_EOL, $stuff); Once you have the text into an array, use the sort function to sort it, and then loop through it and print...
Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...
Design and code a JAVA program called ‘Grades’. ? Your system should store student’s name, and his/her course names with grades. ? Your system should allow the user to input, update, delete, list and search students’ grades. ? Each student has a name (assuming no students share the same name) and some course/grade pairs. If an existing name detected, user can choose to quit or to add new courses to that student. ? Each student has 1 to 5 courses,...
Find Bugs in the pseudocode// A high school is holding a recycling competition// This program allows a user to enter a student's // year in school (1 through 4)// and number of cans collected// Data is entered continuously until the user wnats to quit// After headings, output is four lines// one for each school year classstart Declarations num year num cans num SIZE = 4 num QUIT = 9 ...
please help Write a simple program with Student class having STL list of Record's structure as a member. 1. Records of the Students are not accessible to the outside world. 2. Student shall output its standing (Freshman, Sophomore etc). 3. A Student can only be created with the name 4. A class can only be added if there is a class name and the passing grade. Driver program creates a Student, adds few classes to the Student's records, then prints...