Saturday, 23 December 2017

Table, Order list, Un-oder list, heading and paragraph tags









<!doctype html>
<html>
    <head>
       
        <title>My first page</title>
    </head>
    <body>
    <h1>My first page</h1>
    <h2>My first page</h2>
    <h3>My first page</h3>
    <h4>My first page</h4>
    <h5>My first page</h5>
    <h6>My first page</h6>
    <br>
    <p>i like to design website , it is my hobby. </p>
    <br>
    <ul>
        <li>car</li>
        <li>Motorcycle</li>
        <li>Bus</li>
    </ul>
    <br>
    <ol>
        <li>Car</li>
        <li>motorcycle</li>
        <li>Bus</li>
    </ol>
   
        <table border="1">
            <tr>
            <th>Name</th>
            <th>Contact</th>
               
            </tr>
            <tr>
                <td>
                    Ahmad
                </td>
                <td>
                123456789
                </td>
            </tr>
            <tr>
                <td>Adil</td>
                <td>12345678</td>
            </tr>
            <tr>
                <td>
                    Ahmad
                </td>
                <td>
                    12345678
                </td>
            </tr>
            <tr>
                <td>Adil</td>
                <td>12345678</td>
            </tr>
           
        </table>
        <br><br>
        <table border="5">
            <tr>
            <th>Name</th>
            <th>Contact</th>
            <th>Marks</th>
            </tr>
            <tr>
                <td>Ahmad</td>
                <td>12345678</td>
                <td>98</td>
            </tr>
            <tr>
                <td>Ahmad</td>
                <td>12345678</td>
                <td>98</td>
            </tr>
            <tr>
                <td>ali</td>
                <td>43746334</td>
                <td>78</td>
            </tr>
        </table>
       
    </body>
   
</html>

Sunday, 26 November 2017

Inventory System by using HTML, CSS and Javascript








Inventory system by using HTML, CSS and javascript

<html>
<head>
<title>Product Price</title>
<style type="text/css">
#p1
{
    font-family:Times New Roman;
}
#p2
{
    font-family:Times New Roman;
}
#p2
{
    font-family:Times New Roman;
}
#p2
{
    font-family:Times New Roman;
}
#p2
{
    font-family:Times New Roman;
}
#price
{
    font-family:Times New Roman;
}
#table
{
    border:1;
}
#f
{
    background-color:Yellow;
}
#total
{
    background-color:White;
}
</style>
</head>
<body>
<center>
<form name="f"  id="f">
<select name="product">
<option value="-1" >Select Product</option>
<option  value="0" id="p1" onclick="rvalue('p1')">Bread 40</option>
<option  value="1" id="p2" onclick="rvalue('p2')">Egg 12</option>
<option  value="2" id="p3" onclick="rvalue('p3')">Milk Packet 50</option>
<option  value="3" id="p4" onclick="rvalue('p4')">Burgger 60</option>
<option  value="4" id="p5" onclick="rvalue('p5')">Shwarma 40</option>

</select>
<br />
<input type="text" placeholder="Quantity" id="price" />
<button type="button" onclick="sum()">Add</button><br />
</form>
<br />
<table  id="table" border="1">
<tr>
<th>Sr.</th>
<th>Name</th>
<th>unit Price</th>
<th>Quanity</th>
<th>Total Price</th>
</tr>
</table>
<input type="text" id="total" />
<button type="button" onclick= "totall()">Total</button>
</center>

<script type="text/javascript">
    pname = new Array(5);
    pprice = new Array(5);
    pname[0] = "Bread";
    pprice[0] = 40;
    pname[1] = "Eggs";
    pprice[1] = 12;
    pname[2] = "Milk packet";
    pprice[2] = 50;
    pname[3] = "Burgger";
    pprice[3] = 60;
    pname[4] = "Shawarma";
    pprice[4] = 70;
    var index;
    var p=0, total=0, price=0,count=0;
    function rvalue(Pid) {
        index = document.getElementById(Pid).value;
      

    }
    function sum() {
        p = Number(document.getElementById("price").value);
        price = p * pprice[index];
        total += price;
       
        count++;
        var table = document.getElementById("table");
        var row = table.insertRow(-1);
        var cell1 = row.insertCell(0);
        cell1.innerHTML = count;
        var cell2 = row.insertCell(1);
        cell2.innerHTML = pname[index];
        var cell3 = row.insertCell(2);
        cell3.innerHTML = pprice[index];
        var cell4 = row.insertCell(3);
        cell4.innerHTML = p;
        var cell5 = row.insertCell(4);
        cell5.innerHTML = price;
        document.getElementById("f").reset();
        index = 0;
    }
    function totall() {
        document.getElementById("total").value = total;
    }
     
  
</script>


</body>
</html>

Wednesday, 22 November 2017

Use of Colspan and Rownspan in HTML table







Colspan and Rowsapn in HTML Table

<!doctype html />
<html>
<head>


</head>
<body>
<center>
<table border="1">
<tr><td rowspan="3">Day</td>
<td colspan="3">Seminar</td>


</tr>
<tr><td colspan="2">Shedule</td>
<td rowspan="2">Topic</td>


</tr>

<tr><td>Being</td>
<td>End</td>


</tr>
<tr><td rowspan="2">Monday</td>
<td rowspan="2">8:00 am</td>
<td rowspan="2">5:00 am</td>
<td>Intorduction ot XML</td>
</tr>
<tr><td>Validity DDT and RElax</td>

</tr>
<tr><td rowspan="3">Tuesday</td>
<td>8 am</td>
<td>11 am</td>
<td rowspan="2">XP Path</td>
</tr>
<tr><td>11 am</td>
<td>2 pm</td>


</tr>
<tr><td>2 pm</td>

<td>5 pm</td>
<td>Xml Transformation</td>
</tr>
<tr><td>Wednesday</td>
<td>8 am</td>
<td>12 pm</td>
<td>Xml Formatting</td>
</tr>
</table>


</center>
</body>



</html>

Friday, 14 July 2017

Start Posting Again

i am starting posting again here.
if some body have any query related Structural Programming, Object Oriented,  Data Structure, Data Base (Oracle) , PLSQL and HTML contact me at this mail
ahmad.amjad09@gmail.com
ahmad.amjad09@outlook.com
and
+92 3484899762

Sunday, 15 January 2017

Chaining hash function

#include <iostream>
using namespace std;
struct Node
{
int data;
Node *next;
};
class ch
{
private:
Node *first;
int Size;
public:
//constructor
ch(int size)
{
Size=size;
first=new Node [size];
for (int i=0; i<size; i++)
{
first[i]=NULL;
}
}
//hash Function
int hash(int value)
{
return (value%Size);
}
//insert function
void insert(int value)
{
int location=hash(value);
Node *temp=new Node;
temp->data=value;
temp->next=first[location];
first[location]=temp;
}
//search Function
bool search(int value)
{
int location=hash(value);
if (first[location]==NULL)
{
return false;
}
else
{
Node *ptr=first[location];
while (ptr->next!=NULL)
{
if (ptr->data==value)
{
break;
}
else
{
ptr=ptr->next;
}
}
if (ptr->next==NULL)
{

return false;
}
else
{
return true;
}
}
}
// delete fucntion
int del(int value)
{
int location=hash(value);
if (first[location]==NULL)
{
return -1
}
else
{
Node *pre=first[location],*curr=first[location];
while (curr->nex!=NULL)
{
if (curr->data==value)
{
break;
}
else
{
pre=curr;
curr=curr->next;
}
}
if (curr->next==NULL)
{
return -1;
}
else
{
int data=curr->data;
prev->next=curr->nex;
delete curr;
return data;
}
}
}
};

Tuesday, 10 January 2017

Hash functions



#include<iostream>
using namespace std;
const int maxval=20;
struct Data
{
int data;
bool occupied;
};
void insert(Data [],int);
int search(Data [],int);
int Delete(Data[],int);
int main()
{
Data arr[maxval];
int i,val;
for(i=0;i<maxval;i++)
{
arr[i].occupied=false;
}
char opt;
cout<<"******************************Hashing Technique******************************"<<endl<<endl;
cout<<"Now Inserting Data in HASH-TABLE "<<endl<<endl;
for(i=0;i<maxval;i++)
{
cout<<"Enter val "<<i+1<<endl;
cin>>val;
insert(arr,val);
cout<<"Do you want to insert another value ? \npress Y for yes and press any other key for no."<<endl;
cin>>opt;
if(opt!='y' && opt!='Y')
{
break;
}
}
cout<<"You Entered total "<<i+1<<" value(s)"<<endl;
cout<<"Insertion Done Now search the specified data."<<endl<<endl;
cout<<"Enter Data to be searched"<<endl;
cin>>val;
int index;
index=search(arr,val);
if(index==-1)
{
cout<<"Sorry data Not Found "<<endl;
}
else
{
cout<<"value found at index "<<index<<endl;
}
cout<<"Searching Done Now we are about to delete specified data."<<endl<<endl;
cout<<"Enter Data to be delete"<<endl;
cin>>val;
index=Delete(arr,val);
if(index==-1)
{
cout<<"Sorry data Not Found "<<endl;
}
else
{
cout<<"value deleted , it was at at index "<<index<<endl;
}
return 0;
}
void insert(Data arr[],int val)
{
int hashindex=val%maxval;
while(arr[hashindex].occupied!=false)
{
hashindex=hashindex+1;
hashindex=hashindex%maxval;
}
arr[hashindex].data=val;
arr[hashindex].occupied=true;
}

int search(Data arr[],int val)
{
int hashindex=val%maxval;
while(arr[hashindex].occupied!=false)
{
if(arr[hashindex].data==val)
{
return hashindex;
}
hashindex=hashindex+1;
hashindex=hashindex%maxval;
}
return -1;
}

int Delete(Data arr[],int val)
{
int hashindex=val%maxval;
while(arr[hashindex].occupied!=false)
{
if(arr[hashindex].data==val)
{
arr[hashindex].occupied=false;
return hashindex;
}
hashindex=hashindex+1;
hashindex=hashindex%maxval;
}
return -1;
}

Sunday, 1 January 2017

Reverse and Palendroom





#include <iostream>
using namespace std;
int main()
{
int num,revise,digit,original_num;
cout <<"Enter any intrege number" <<endl;
cin >>num;
original_num=num;
revise=0;
while (num!=0){
digit=num%10;
revise=(revise*10)+digit;
num=num/10;
}
cout <<"Revise of number = "<<revise <<endl;
if (revise==original_num){
cout <<"Number is palendrome" <<endl;
}else {
cout <<"Number is not Palendrome" <<endl;
}

return 0;
}