Practical Slip - 4
Practical Slip - 4
A) Write a C++ program to accept Worker information Worker_Name, No_of_Hours_worked, Pay_Rate and Salary. Write
necessary functions to calculate and display the salary of Worker. (Use default value for Pay_Rate)
PHP – A) Define a class Employee having private members — id, name, department, salary. Define parameterized
constructors. Create a subclass called “Manager” with private member bonus. Create 3 objects of the Manager class and
display the details of the manager having the maximum total salary (salary + bonus).
slip4-p2-q2.php <cricket>
<?php <player>def</player>
$d=new DOMDocument(); <runs>100</runs>
$d->load("slip4-p1-q2.xml"); <wickets>40</wickets>
<noofnotout>10</noofnotout>
$run=$d->getElementsByTagName('runs'); </cricket>
$wic=$d->getElementsByTagName('wickets');
$name=$d->getElementsByTagName('player'); <cricket>
<player>pqr</player>
foreach($name as $n) <runs>1020</runs>
{ <wickets>60</wickets>
if($run>='12*00' && $wic>='50') <noofnotout>10</noofnotout>
echo "<br>".$n->textContent; </cricket>
else "not";
} <cricket>
?>. <player>xyz</player>
slip4-p1-q2.xml <runs>9000</runs>
<?xml version='1.0' encoding='UTF-8'?> <wickets>90</wickets>
<cricketinfo> <noofnotout>40</noofnotout>
<cricket> </cricket>
<player>abc</player>
<runs>1000</runs> <cricket>
<wickets>50</wickets> <player>lmn</player>
<noofnotout>10</noofnotout> <runs>170</runs>
</cricket> <wickets>80</wickets>
<noofnotout>8</noofnotout>
</cricket>
</cricketinfo>