practical - Week 4

2023-08-23

Practical 1: Write the php code for the given scenario. Take the input from the commandline, use php interactive mode (php -a).

Hint:

$input = trim(fgets(STDIN)); or
trim(fscanf(STDIN, "%d\n", $numeric_input));

Practical 2: Write the switch case for the above practical.

Practical 3: If the marks obtained by a student in five different subjects are input through the keyboard, write a program to find out the aggregate marks and percentage marks obtained by that student. Assume that the maximum marks that can be obtained by a student in each subject is 100 and also output whether the student passed or failed in that subject.