Using WebMatrix, choose either empty PHP website or empty HTML website as the te
ID: 3776742 • Letter: U
Question
Using WebMatrix, choose either empty PHP website or empty HTML website as the template to 1) (70 points) Create a PHP-enabled website. This website should define and use a Pencil class with following members. Properties $sharp: string type, with "yes" or "no" values, $diameter: number type, $darkness: number type Standard constructor, with 3 parameters Member functions o writeWith(): no return, no parameter, use output statementdescribe how to use a pencil in writing. o displayVal(): no return, no parameter, display the name and current value of every property. 2) (30 points) In the primary PHP script, create two Pencil objects with the standard constructor, then call every member function (not including the constructor) from each object.
Explanation / Answer
<xsl:output method=”xml” indent=”yes” />
<xsl:template match=”/”>
<!-- Create the HTML Code for Pencil class. -->
<HTML>
257
Web Matrix and XML
<HEAD>
<TITLE>Remote Performance Monitor</TITLE>
</HEAD>
<BODY>
<CENTER><H3>Performance Monitor Results</H3></CENTER>
<TABLE BORDER=”2”>
<TR>
<TH>Time</TH>
<TH>Percent User Time Value</TH>
</TR>
<xsl:apply-templates select=”//Item”/>
</TABLE>
</BODY>
</HTML>
</xsl:template>
<!-- XSL template section that describes use of pencil. -->
<xsl:template match=”Item”>
<TR>
<TD>
<xsl:value-of select=”Time”/>
</TD>
<TD>
<xsl:value-of select=”Data”/>
</TD>
</TR>
</xsl:template>
</xsl:Pencil>