Professional Documents
Culture Documents
Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ItemCalc
{
class Program
{
static void Main(string[] args)
{
}
Console.WriteLine("ENter Discount in %");
int disc =Convert.ToInt32( Console.ReadLine());
Output:
Student Class Code
Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Student
{
class Student
{
string SName;
String FName;
String Class;
string Section;
int Regno;
String address;
string dob;
string age;
string email;
Console.WriteLine("");
Console.WriteLine("Student's Name: {0}", SName);
Console.WriteLine("");
Console.WriteLine("Son/Daughter Of: {0}", FName);
Console.WriteLine("");
Console.WriteLine(" Class: {0}", Class);
Console.WriteLine("");
Console.WriteLine(" Section: {0}", Section);
Console.WriteLine("");
Console.WriteLine(" Reg.No#: {0}", Regno);
Console.WriteLine("");
Console.WriteLine(" Address: {0}", address);
Console.WriteLine("");
Console.WriteLine(" Date of Birth: {0}", dob);
Console.WriteLine("");
Console.WriteLine(" Age: {0}", age);
Console.WriteLine("");
Console.WriteLine(" E-mail Id: {0}", email);
Console.WriteLine("");
}
class Student1
{
Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ITEM_Calculation
{
class ITEM
{
int[] num = new int[5];
string[] PName = new string[5];
double[] unitprice = new double[5];
int[] quantiy = new int[5];
double[] TPrice = new double[5];
double discount;
double[] Total = new double[5];
double Sum = 0;
num[i] = i + 1;
Console.WriteLine("\nProduct:{0}", num[i]);
}
public void Display()
{
Console.WriteLine("ENter Discount in %");
int disc = Convert.ToInt32(Console.ReadLine());
}
}
}
Output:
Write a program in Wnindows Form Application. Generate electric bill, input User Name and pasword
12345, login and enter information required to generate bill.
Coding Form 1:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Suigas
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
}
Coding Form 2:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Suigas
{
public partial class Form2 : Form
{
public static string name, type, address;
public static double cunit, punit, conUnit, prsUnit, ttlbill, mtrno, units;
public Form2()
{
InitializeComponent();
}
Coding Form 3:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Suigas
{
public partial class Form3 : Form
{
public static double m, pc, amt;
public static string t;
public static string nme, ad;
public Form3()
{
InitializeComponent();
}
nme = Form2.name;
label1.Text = nme.ToString();
ad = Form2.address;
label2.Text = ad.ToString();
m = Form2.mtrno;
label3.Text = m.ToString ();
pc = Form2.conUnit;
label4.Text = pc.ToString();
t = Form2.type;
label5.Text = t.ToString();
amt = Form2.ttlbill;
label6.Text = amt.ToString();
}
}
}
}
namespace CarClass
{
class Car
{
string Name;
string model;
string made;
string colour;
string EnginePower;
string AutoOrNon;
}
}
class program1
{
static void Main(string[] args)
{
Car c1 = new Car();
c1.Data();
c1.Display();
}
}
}
Output:
Cell Class Code
Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CellPhone
{
class cellphone
{
string Name;
string model;
string made;
string IMEI;
string camera;
int storage;
int extStorage;
}
public void Display()
{
Console.WriteLine(" Name: {0}", Name);
Console.WriteLine("");
Console.WriteLine(" Model is: {0}", model);
Console.WriteLine("");
Console.WriteLine(" Made in: {0}", made);
Console.WriteLine("");
Console.WriteLine(" IMEI # is: {0}", IMEI);
Console.WriteLine("");
Console.WriteLine(" Megapixel:{0}", camera);
Console.WriteLine("");
Console.WriteLine(" Internal sorage: {0}", storage);
Console.WriteLine("");
Console.WriteLine("External storage: {0}", extStorage);
Console.WriteLine("");
}
}
class program1
{
static void Main(string[] args)
{
cellphone c1 = new cellphone();
c1.Data();
c1.Display();
}
}
}
Write a simple program in which calculate the total amount of items that are sold.
Calculate Total Price after discount.
Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ItemCalc
{
class Program
{
static void Main(string[] args)
{
}
Console.WriteLine("ENter Discount in %");
int disc =Convert.ToInt32( Console.ReadLine());
Output:
Write a program to add distance give in meter, kilometer, and centieter by
using operator overloading method.
Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Distance
{
int kilometer;
int meter;
int centimeter;
km = fd.kilometer + sd.kilometer;
m = fd.meter + sd.meter;
cm = fd.centimeter + sd.centimeter;
Output:
namespace exceptionhandling
{
class arrayexception : Exception
{
public arrayexception() :
base("please enter the command line arguement")
{
}
}
class throwarrayexception
{
public throwarrayexception(int a)
{
try { checksize(a); }
catch (arrayexception ae)
{
Console.WriteLine(ae.Message);
}
}
public void checksize(int a)
{
if (a == 0)
throw new arrayexception();
else
{
Console.WriteLine("the size of arguements passed to main method is {0}", a);
}
}
class program
{
static void Main(string[] args)
{
new throwarrayexception(args.Length);
}
}
}
}
OUTPUT:
}
}
}
Take 10 inputs from the user and assign them into two arrays (make 2 arrays of 5 lengths
each), merge those arrays and obtain the result in the sorted manner.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Merg
{
class Program
{
static void Main(string[] args)
{
Output:
Create a class ElectricityBilling that contains a function which calculates total billing amount with the
help of inputs and displays the yearly bill as well. Take name, consumer_id, consumer_type as input,
where as pressure and consumed units are available by default as static members. Calculate the
monthly bill based on the type of consumer. Also display the yearly bill.
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Atif
{
class ElectricityBilling
{
static string name, consumerId, consumerType;
static double pressure = 5.5;
static double consumerUnit=2.3;
public static void totalBill()
{
class Program
{
static void Main(string[] args)
{
ElectricityBilling.totalBill();
}
}
}
Screen Shor
How to make Simple Phone Book
Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PhoneBook
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
Screen Shot
- See more at: http://softproweb.blogspot.in/2013/06/how-to-make-simple-phone-
book.html#sthash.SniZpsfq.dpuf
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Age_Calculator
public Form1()
InitializeComponent();
DateTime dateOfBirth;
textBox1.Text = (ageInYears).ToString();
textBox2.Text = (ageInMonths).ToString();
textBox3.Text = (ageInDays).ToString();
{
toolTip1.SetToolTip(this.button1, "Enter to Calculate Your Age");
Application.Exit();
toolTip1.SetToolTip(this.button2, "Exit");
DialogResult result;
if (result == DialogResult.No)
e.Cancel = true;
}
- See more at: http://softproweb.blogspot.in/2013/04/how-to-make-simple-age-calculator-in-
c.html#sthash.5JLZ0j5r.dpuf
<SCRIPT>
function myFun()
{
var a=document.form1.txtname.value;
document.getElementById("demoname").innerHTML=a;
var b=document.form1.txtfname.value;
document.getElementById("demofname").innerHTML=b;
var c=document.form1.txtins.value;
document.getElementById("demoins").innerHTML=c;
var d=document.form1.txtbatch.value;
document.getElementById("demobatch").innerHTML=d;
var e=document.form1.txtoffice.value;
document.getElementById("demooffice").innerHTML=e;
var f=document.form1.txtweb.value;
document.getElementById("demoweb").innerHTML=f;
var g=document.form1.txtit.value;
document.getElementById("demoit").innerHTML=g;
var h=document.form1.txtc.value;
document.getElementById("democ").innerHTML=h;
var txt1=eval(parseFloat(document.form1.txtoffice.value)+parseFloat(document.form1.txtweb.value)
+parseFloat(document.form1.txtit.value)+parseFloat(document.form1.txtc.value));
document.getElementById("demototal").innerHTML=txt1;
var txt2=eval(parseFloat(txt1*100)/400);
document.getElementById("demoper").innerHTML=txt2.toFixed(2)+"%";
switch(true)
{
case(txt2>=80):
document.getElementById("demograde").innerHTML="A1";
break;
case(txt2>=70):
document.getElementById("demograde").innerHTML="A";
break;
case(txt2>=60):
document.getElementById("demograde").innerHTML="B";
break;
case(txt2>=50):
document.getElementById("demograde").innerHTML="C";
break;
case(txt2>=40):
document.getElementById("demograde").innerHTML="D";
break;
case(txt2<40):
document.getElementById("demograde").innerHTML="Fail";
break;
}
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<DIV class="color">
<H1 align="center"style="font-family:cambria;font-size:40";><U>STUDENT MARKSHEET</H1>
<FIELDSET>
<LEGEND> STUDENT INFORMATION </LEGEND>
<TABLE align="center" id="tbl">
<FORM name="form1">
</TR>
<TD width="140">Name:</TD> <TD><INPUT type="text" name="txtname"/></TD>
<TD> Father Name:</TD><TD> <INPUT type="text" name="txtfname"/></TD>
</TR>
<TR>
<TD width="140" > Institute Name:</TD><TD> <INPUT type="text" name="txtins"/></TD>
<TD style="text-indent:16px">Batch:</TD><TD> <INPUT type="text" name="txtbatch"/></TD>
</TR>
</TABLE>
</FIELDSET></BR>
<FIELDSET>
<LEGEND> SUBJECTS MARKS </LEGEND>
<TABLE id="tbl2">
<TR>
<TD> Office Automation:</TD><TD> <INPUT type="text" name="txtoffice" maxlength="2" size="10"/>
Out of 100 </TD>
</TR>
<TR>
<TD> Web Designing:</TD><TD> <INPUT type="text" name="txtweb" maxlength="2" size="10"/>
Out of 100</TD>
</TR>
<TR>
<TD> IT:</TD><TD> <INPUT type="text" name="txtit" maxlength="2" size="10"/> Out of 100</TD>
</TR>
<TR>
<TD> C# Programing:</TD><TD> <INPUT type="text" name="txtc" maxlength="2" size="10" /> Out of
100</TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TABLE>
</FIELDSET>
<DIV class="btn">
<button style="font-size:17" type="button" onclick='myFun()'>Submit</button>
<button style="font-size:17" type="Reset">Reset</button>
</DIV>
<DIV class="demo">
<TABLE border="1">
<TR>
<TH colspan="8" width="240"> Student Information </TH>
</TR>
<TR>
<TD width="135">Name:</TD><TD><FONT face="arial" id="demoname"></FONT></TD>
</TR>
<TR>
<TD width="135">Father Name:</TD><TD><FONT face="arial" id="demofname"></FONT></TD>
</TR>
<TR>
<TD width="135">Institute Name:</TD><TD><FONT face="arial" id="demoins"></FONT></TD>
</TR>
<TD width="135">Batch:</TD> <TD><FONT face="arial" id="demobatch"></FONT></TD>
</TR>
<TR>
<TH colspan="8" width="240"> Subjects Marks </TH>
</TR>
<TR>
<TD width="135">Office Automation:</TD> <TD><FONT face="arial"
id="demooffice"></FONT></TD>
</TR>
<TR>
<TD width="135">Web Designing:</TD><TD><FONT face="arial" id="demoweb"></FONT></TD>
</TR>
<TD width="135">IT:</TD><TD><FONT face="arial" id="demoit"></FONT></TD>
</TR>
<TR>
<TD width="135">C# Programing:</TD><TD><FONT face="arial" id="democ"></FONT></TD>
</TR>
<TR>
<TH colspan="8" width="240"> Marks Result </TH>
</TR>
<TR>
<TD width="135">TOTAL:</TD><TD> <FONT face="arial" id="demototal"></FONT></TT></TD>
</TR>
<TR>
<TD width="135">Percentage:</TD><TD><FONT face="arial" id="demoper"></FONT></TD>
</TR>
<TR>
<TD width="135">Grade:</TD><TD><FONT face="arial" id="demograde"></FONT></TD>
</TR>
</TABLE>
</DIV>
</DIV>
</BODY>
</HTML>
Screen Shot:
Code
sing System;
using System.Collections.Generic;
using System.Text;
namespace wasiq_khan
{
class DisplayData
{
public DisplayData()
{
Programe = "Computer Science";
Campus = "Bahria University Karachi Campus";
semister = "4Th Semister";
}
public DisplayData(string FirstName, string Lastname, string Father
Name, string Address, string Gender, string Email)
{
}
class Program
{
static void Main(string[] args)
{
string FiName="";
string Laname="";
string FName="";
string Addr="";
string Gend="";
string Ema="";
}
}
}
screen shot
- See more at: http://softproweb.blogspot.in/2013/05/how-to-make-student-information-
program.html#sthash.lB2cDQ6A.dpuf
Develop an application with one screen that calculates the monthly salary of an
employee. Your application should satisfy the following requirements:
9. An Exit button.
Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ClassLibrary1;
namespace lab3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
cal.Enabled = false;
}
int sal = 0;
sal += int.Parse(cb2.Text);
if (c1.Checked == true)
sal += 5000;
if (c2.Checked == true)
sal += 5000;
if (c3.Checked == true)
sal += 5000;
if (c4.Checked == true)
sal += 5000;
sal += (10000 * lb1.SelectedIndices.Count);
if (c5.Checked == true)
sal -= 1500;
if (c6.Checked == true)
sal -= 2500;
tb2.Text = sal.ToString();
}
}
Screen Shot
- See more at: http://softproweb.blogspot.in/2013/05/develop-application-with-one-
screen.html#sthash.QW03ihhv.dpuf
Resume in Html
Code
<html >
<head>
<title>Resume Of Waqeeh Ul Hasan</title>
</head>
<body>
<h3> Resume Of <h1>Waqeeh Ul Hasan</h3>
<p>
<img border="0" src="http://lh6.ggpht.com/-
kYxgHwfb6V4/UawlWdsss_I/AAAAAAAAApo/M_TMAnnkYao/
166571_367932973267402_1468747437_n.jpg" alt="Pulpit rock" width="74" height="78">
<br>123 Gulshan-e-Iqbal Block 10/A<br>
Karachi, Pakistan and 75360
</p><p>
111 999 111<br>
Resum@gmail.com
</p> <hr>
<h2>Skills</h2><ol>
<li> Web Design </li>
<li> Interface Desig </li>
<li> Project Direction</li>
</ol><hr><h2>Technical </h2>
<ol>
<li> XHML </li>
<li> CSS </li>
<li> Javascript </li>
<li> Jquery </li>
<li> PHP</li>
<li> Windows Server 2008 </li>
</ol><hr>
</html>
Screen Shot
LAB 02:
Lab Tasks:
4. Change the value of width in <HR> tag from 50% to 80%. Attach printout of modified page.
Code
<html >
<head>
<title>Resume Of Waqeeh Ul Hasan</title>
</head>
<body>
Screen Shot:
4. Write a code for HTML page with the <ELEMENT>, <H>, <B>, <P>, <A>, <BR> and
<HR> tags.
Code:
<html >
<head>
<title>Resume Of Waqeeh Ul Hasan</title>
</head>
<body>
Screen Shot:
Create Signup page with Validation using JavaScript - See more at:
http://softproweb.blogspot.in/2013/12/create-signup-page-with-validation.html#sthash.bgCRBOi9.dpuf
Code:
<html>
<head>
if(document.form1.lid.value=="")
{
alert("Plese Enter Login Id");
document.form1.lid.focus();
return false;
}
if(document.form1.pass.value=="")
{
alert("Plese Enter Your Password");
document.form1.pass.focus();
return false;
}
if(document.form1.cpass.value=="")
{
alert("Plese Enter Confirm Password");
document.form1.cpass.focus();
return false;
}
if(document.form1.pass.value!=document.form1.cpass.value)
{
alert("Confirm Password does not matched");
document.form1.cpass.focus();
return false;
}
if(document.form1.name.value=="")
{
alert("Plese Enter Your Name");
document.form1.name.focus();
return false;
}
if(document.form1.address.value=="")
{
alert("Plese Enter Address");
document.form1.address.focus();
return false;
}
if(document.form1.city.value=="")
{
alert("Plese Enter City Name");
document.form1.city.focus();
return false;
}
if(document.form1.phone.value=="")
{
alert("Plese Enter Contact No");
document.form1.phone.focus();
return false;
}
if(document.form1.email.value=="")
{
alert("Plese Enter your Email Address");
document.form1.email.focus();
return false;
}
e=document.form1.email.value;
f1=e.indexOf('@');
f2=e.indexOf('@',f1+1);
e1=e.indexOf('.');
e2=e.indexOf('.',e1+1);
n=e.length;
if(!(f1>0 && f2==-1 && e1>0 && e2==-1 && f1!=e1+1 && e1!=f1+1 && f1!=n-1 && e1!=n-1))
{
alert("Please Enter valid Email");
document.form1.email.focus();
return false;
}
return true;
}
</script>
<link href="quiz.css" rel="stylesheet" type="text/css">
<style type="text/css">
body,td,th {
color: #C30;
}
a:link {
color: #06F;
}
a:visited {
color: #06F;
}
.d {
color: #0F0;
}
.dff {
color: #00F;
}
.y {
color: #FF0;
}
.style7 {
color: #0F0;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body><center></center>
<br>
<table width="100%" height="534" border="0">
<tr>
<td width="206" rowspan="2" valign="top"> </td>
<td width="651" height="57"><h1 align="left"><span class="d">New</span> <span
class="dff">User</span><span class="style8"> <span class="y">Signup</span></span></h1></td>
</tr>
<tr>
<td><form name="form1" method="post" action=" " onSubmit="return check();">
<table width="532" height="341" border="0" align="left" bordercolor="#CCFF99"
bordercolordark="#00CCFF" cellpadding="2" cellspacing="3" >
<tr>
<td><div align="left" class="style7">Login Id </div></td>
<td><input type="text" name="lid"></td>
</tr>
<tr>
<td class="style7">Password</td>
<td><input type="password" name="pass"></td>
</tr>
<tr>
<td class="style7">Confirm Password </td>
<td><input name="cpass" type="password" id="cpass"></td>
</tr>
<tr>
<td class="style7">Name</td>
<td><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td valign="top" class="style7">Address</td>
<td><textarea name="address" id="address"></textarea></td>
</tr>
<tr>
<td valign="top" class="style7">City</td>
<td><input name="city" type="text" id="city"></td>
</tr>
<tr>
<td valign="top" class="style7">Phone</td>
<td><input name="phone" type="text" id="phone"></td>
</tr>
<tr>
<td valign="top" class="style7">E-mail</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Signup">
</td>
</tr>
</table>
</form></td>
</tr>
</table>
<br><br><br><br><br>
<center></center>
</body>
</html>
Screen Shot:
- See more at: http://softproweb.blogspot.in/2013/12/create-signup-page-with-
validation.html#sthash.bgCRBOi9.dpuf
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CoOl Javascript Validation</title>
<script type="text/javascript" src="cvalidate.js"></script>
<style type="text/css">
.heading
{
color:#0099FF;
font-weight:bolder;
font-size:20px;
}
.txt
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
</style>
</head>
<body>
<tr>
<td align="left" class="txt">Username *</td>
<td align="right"><input type="text" name="username" id="username" size="28" title="Username"
class="required alpha" /></td>
</tr>
<tr>
<td align="left" class="txt">Password *</td>
<td align="right"><input type="password" name="password" id="password" size="28"
title="Password" class="required alpha min 6 max 20 match cpassword" /></td>
</tr>
<tr>
<td align="left" class="txt">Confirm Password *</td>
<td align="right"><input type="password" name="cpassword" id="cpassword" size="28" title="Confirm
Password" class="required alpha" /></td>
</tr>
<tr>
<td align="left" class="txt">First Name *</td>
<td align="right"><input type="text" name="fname" id="fname" size="28" title="First Name"
class="required text" /></td>
</tr>
<tr>
<td align="left" class="txt">Last Name</td>
<td align="right"><input type="text" name="lname" id="lname" size="28" title="Last Name" /></td>
</tr>
<tr>
<td align="left" class="txt">Age *</td>
<td align="right"><input type="text" name="age" id="age" size="28" title="Age" class="required
number min 10 max 100 " /></td>
</tr>
<tr>
<td align="left" class="txt">Email *</td>
<td align="right"><input type="text" name="email" id="email" size="28" title="Email" class="required
email" /></td>
</tr>
<tr>
<td align="left" class="txt">Phone *</td>
<td align="right"><input type="text" name="phone" id="phone" size="28" title="Phone"
class="required regex ^\-?\d+$" /></td>
</tr>
<tr>
<td align="left" class="txt">Fax</td>
<td align="right"><input type="text" name="fax" id="fax" size="28" title="Fax" /></td>
</tr>
<tr>
<td align="left" class="txt">Date Of Birth *</td>
<td align="right"><input type="text" name="dob" id="dob" size="28" title="Date Of Birth"
class="required date" /></td>
</tr>
<tr>
<td align="left" class="txt">Website *</td>
<td align="right"><input type="text" name="website" id="website" size="28" title="Website"
class="required web" /></td>
</tr>
<tr>
<td align="left" class="txt">Country *</td>
<td align="left">
<select name="country" id="country" title="Country" class="required">
<option value="">--- Select ---</option>
<option value="Canada">Canada</option>
<option value="UK">UK</option>
<option value="USA">USA</option>
<option value="Pakistan">Pakistan</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
<tr>
<td align="left" class="txt">Gender *</td>
<td align="left">
<input type="radio" name="gender" value="m" title="Gender" class="required" />Male
<input type="radio" name="gender" value="f" title="Gender" class="required" />Female
</td>
</tr>
<tr>
<td align="left" class="txt">Disclaimer *</td>
<td align="left">
<input type="checkbox" name="disclaimer" value="1" title="Disclaimer" class="required" />
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type="submit" name="btnSubmit" value="Submit Form" />
</td>
</tr>
</table>
</form>
<br /><br />
Screen Shot:
- See more at: http://softproweb.blogspot.in/2013/12/html-validation-with-
javascript.html#sthash.aLi3sUTE.dpuf
Code:
<head>
<title>
lab 7 task 1
</title>
<style>
.o{
color: #F30;
border-color: blue;
}
#a{background-color:grey;}
</style>
</head>
<body>
<table border="0" align="center" cellspacing="4" cellpadding="2" witdh="100%" height="40%">
<th class="o">ID</th>
<th class="o">NAME</th>
<th class="o">OCCUPATION</th>
<th class="o">APPROX.LOCATION</th>
<th class="o">PRICE</th>
<tr id="a">
<td>203A</td>
<td>Hasan<A HREF="http://softproweb.blogspot.com/">(bio)</A></td>
<td>Front-man</td>
<td>Los Angeles</td>
<td>$39.95</td>
</tr>
<tr>
<td>141B</td>
<td>Amir<A HREF="http://softproweb.blogspot.com/">(pic.bio)</A></td>
<td>Singer</td>
<td>Newyork</td>
<td>$39.95</td>
</tr>
<tr id="a">
<td>2031</td>
<td>Zain<A HREF="http://softproweb.blogspot.com/">(pic)</A></td>
<td>Producer</td>
<td>Newyork</td>
<td>$19.95</td>
</tr>
<tr>
<td>007F</td>
<td>Kashif<A HREF="http://softproweb.blogspot.com/">(bio.press)</A></td>
<td>Singer</td>
<td>Omaha</td>
<td>$11.95</td>
</tr>
<tr id="a">
<td>8A05</td>
<td>Faisal<A HREF="http://softproweb.blogspot.com/">(pic)</A></td>
<td>DJ</td>
<td>London</td>
<td>$19.95</td>
</tr>
<tr>
<td>6636</td>
<td>talha<A HREF="http://softproweb.blogspot.com/">(bio.press)</A></td>
<td>Keytarist</td>
<td>London</td>
<td>$39.95</td>
</tr>
</table>
</body>
Screen Shot:
using System;
using System;
void InterfaceB.MethodA()
{
Console.WriteLine("InterfaceB implementation of MethodA()");
}
class MainClass
{
public static void Main()
{
MyClass myClass = new MyClass();
Console.WriteLine("Calling myClass.MethodA()");
myClass.MethodA();
}
Calling myClass.MethodA()
InterfaceA implementation of MethodA()
Calling mySteerable.MethodA()
InterfaceB implementation of MethodA()
Calling myDrivable.MethodA()
InterfaceA implementation of MethodA()
using System;
interface InterfaceOne
{
void Execute();
}
interface InterfaceTwo
{
void Execute();
}
class MainClass
{
public static void Main()
{
MyImplementation MyImplementation = new MyImplementation();
using System;
interface InterfaceOne
{
void Execute();
}
interface InterfaceTwo
{
void Execute();
}
class MainClass
{
public static void Main()
{
MyImplementation MyImplementation = new MyImplementation();
MyImplementation.Execute();
}
}
InterfaceOne.Execute implementation
using System;
class MyClass
{
static int myValue;
class MainClass
{
static void Main()
{
Console.WriteLine("Init Value: {0}", MyClass.StaticProperty);
MyClass.StaticProperty = 10;
Console.WriteLine("New Value : {0}", MyClass.StaticProperty);
}
}
Init Value: 0
New Value : 10
using System;
class MyClass
{
class MyCounter
{
public int Count = 0;
}
public MyClass() {
counter = new MyCounter();
}
public int Incr() {
return counter.Count++;
}
public int GetValue() {
return counter.Count;
}
}
class MainClass
{
static void Main()
{
MyClass mc = new MyClass();
mc.Incr();
mc.Incr();
mc.Incr();
mc.Incr();
mc.Incr();
mc.Incr();
using System;
class MainClass
{
delegate int MyDelegate(string s);
static void Main(string[] args)
{
string MyString = "Hello World";
Multicast(MyString);
}
static int DoSomething(string s)
{
Console.WriteLine("DoSomething");
return 0;
}
static int DoSomething2(string s)
{
Console.WriteLine("DoSomething2");
return 0;
}
}
DoSomething
DoSomething2
using System;
class MainClass
{
delegate int MyDelegate(string s);
static void Main(string[] args)
{
string MyString = "Hello World";
return 0;
}
static int DoSomething2(string s)
{
Console.WriteLine("DoSomething2");
return 0;
}
}
DoSomething
using System;
class MyClass
{
public void nonStaticMethod()
{
Console.WriteLine("nonStaticMethod");
}
class MainClass
{
static void Main()
{
MyClass t = new MyClass();
FunctionToCall functionDelegate;
functionDelegate = t.nonStaticMethod;
functionDelegate += MyClass.staticMethod;
functionDelegate += t.nonStaticMethod;
functionDelegate += MyClass.staticMethod;
functionDelegate();
}
}
nonStaticMethod
staticMethod
nonStaticMethod
staticMethod
using System;
class MyClass
{
public void nonStaticMethod()
{
Console.WriteLine("nonStaticMethod");
}
class MainClass
{
static void Main()
{
MyClass t = new MyClass();
FunctionToCall functionDelegate;
functionDelegate = t.nonStaticMethod;
functionDelegate += MyClass.staticMethod;
functionDelegate += t.nonStaticMethod;
functionDelegate += MyClass.staticMethod;
functionDelegate();
}
}
nonStaticMethod
staticMethod
nonStaticMethod
staticMethod
using System;
using System;
class MainClass
{
public static void Main()
{
Person myPerson = new Person("Price", 32);
DelegateDescription myDelegateDescription = new
DelegateDescription(myPerson.NameAndAge);
string d = myDelegateDescription();
Console.WriteLine(d);
}
}
personDescription = Price is 32 years old
M is 140 mph
using System;
class MainClass {
using System;
class MainClass {
}
replaceSpaces
removeSpaces
reverseSpaces
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
}
3