Page 1 of 1

helppppppppppp!!!

Posted: Sat Oct 08, 2005 4:40 am
by benkanege
recently we were given the following assignment

Question 1

In a certain institution the grading system is as below.

Marks Grade Points

80 – 100 A 5.0
75 – 79 B+ 4.5
70 – 74.9 B 4.0
65 – 69.9 B- 3.5
60 – 64.9 C+ 3.0
55 – 59.9 C 2.5
50 – 54.9 C- 2.0
10 – 49.9 F 0.5
0 – 9.9 F- 0

Data will be read from a MySQL database and processed by a PHP code.
Develop the PHP code for the processing task only. The code should include a function with urguments: Student No, Student Name , Marks.

The code should generate an output with this format

Student No Name Marks Grade Points

U/004 Otim Paul 68 B- 3.5
U/038 Muragui Mary 75 B+ 4.5








Question 2

Write a PHP code that will generate the table below

Item No. Cost Tax Storage Cost Total Cost Sale Price
225 3000
226 3500
227 4000
228 4500
229 5000
230 5500
231 6000
232 6500


Note:
a) All figures should be integers with no decimal points
b) Values of tem No and Cost columns should be automatically generated by the code
c) Tax is 10% of the cost
d) Storage cost is 5% of the sum of Cost and Tax
e) Total Cost is the sum of Cost, Tax and Storage Cost
f) Sale Price is such that there is a profit of 20% on Total Cost
g) You must use a function with arguments that hold variables for:
· Starting Item No (eg 225 in the above example)
· Number of Rows (eg 8 in the above example)
· Starting Cost value (eg 3000 in the above example)



can somebody help me?

Posted: Sat Oct 08, 2005 5:33 am
by n00b Saibot
Hints
====
Q1.

Code: Select all

if($marks >= 80 && $marks <= 100)
{
 $grad = 'A';
 $pts  = 5;
}
else //match others
Q2.

Code: Select all

function  printResult($No, $Name, $Marks)
{
 // same as above
}
Q3. also same as above