Sunday, April 3, 2022

Average Grade Solver in PHP

 A simple program that will ask the user to give prelim, midterm, and endterm grade and then the program will compute the average grade of the student using PHP programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg


=================================================

Want to support my channel?


GCash Account


Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada





Program Listing

index.php

<?php if(isset($_POST["grade1"], $_POST["grade2"], $_POST["grade3"])) { $calc = $_POST["grade1"] + $_POST["grade2"] +$_POST["grade3"]; $calc = round($calc / 3, 2); $avg = '<div>You average grade is: <strong>'.$calc.'</strong></div>'; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Average Grade Solver</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; } body { min-height: 100vh; display: flex; justify-content: center; align-items: center; background-color: #f1f1f1; font-family: sans-serif; } main { padding: 30px; border-radius: 2px; background-color: #fff; } h1 { margin-bottom: 10px; line-height: 1; text-transform: uppercase; font-size: 28px; text-align: center; } h2 { margin-bottom: 30px; line-height: 1; font-size: 20px; text-align: center; } .block { margin: 0 auto 10px; } label { display: block; margin-bottom: 5px; } input { padding: 8px; width: 100%; } button { padding: 8px 16px; background-color: #607d8b; color: #fff; outline: 0; border: 0; border-radius: 3px; cursor: pointer; width: 150px; width: 100%; margin-bottom: 20px; } button + div { font-size: 18px; text-align: center; background-color: #ffeb3b; padding: 10px; border-radius: 3px; } </style> </head> <body> <main class="container"> <h1>Average Grade Solver in PHP</h1> <h2>Jake R. Pomperada, MAED-IT, MIT</h2> <form action="" method="post"> <div class="block"> <label for="grade1">Give Prelim Grade:</label> <input type="number" min=0 name="grade1" id="grade1"> </div> <div class="block"> <label for="grade2">Give Midterm Grade:</label> <input type="number" min=0 name="grade2" id="grade2"> </div> <div class="block"> <label for="grade3">Give Final Grade:</label> <input type="number" min=0 name="grade3" id="grade3"> </div> <button type="submit">Submit</button> <?php if(isset($avg)) echo $avg; ?> </form> </main> </body> </html>


No comments:

Post a Comment