HOME

Thursday, November 10, 2016

WML programs to check whether year is leap year or not. if not then sum of year is printed.

#WML File
<?xml version="1.0" ?>
<wml>
<card id="card1" title="armstrong number">
<do type="accept" label="Check Year">
<go href="leap.wmls#check()"/>
</do>
</card>
</wml>

#WMLS script
extern function check()
{
var num=Dialogs.prompt("Enter year",0);
var year=Lang.parseInt(num);
var year1=year;
var rem;
var sum=0;
if(year%4==0 || year%400==0)
{
Dialogs.alert("It is leap year");
}
else
{
Dialogs.alert("it is not leap year");
while(year1>0)
{
rem=year1%10;
sum+=rem;
year1=year1 div 10;
}
Dialogs.alert("The sum of year is "+sum);
}
}

WML program to check whether given number is armstrong or not.

#WML file
<?xml version="1.0" ?>
<wml>
<card id="card1" title="armstrong number">
<do type="accept" label="Check Number">
<go href="function.wmls#check()"/>
</do>
</card>
</wml>

#WMLS file
extern function check()
{
var number=Dialogs.prompt("Enter Number",0);
var n=Lang.parseInt(number);
var num=n;
var sum=0;
var rem;
if(n==0)
{
Dialogs.alert("It is not a armstrong Number");
}
else if(n>=1 && n<=9)
{
Dialogs.alert("It is armstrong Number");
}
else
{
while(n>0)
{
rem=n%10;
sum+=rem*rem*rem;
n=n div 10;
}
if(sum==num)
{
Dialogs.alert("It is armstrong Number");
}
else
{
Dialogs.alert("It is not armstrong Number");
}
}
}

Wednesday, November 9, 2016

WML program to check whether the given number is palindrome or not.

#WML FILE
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="card1">
<p>
<do type="accept" label="Check Number">
<go href="prime.wmls#check()"/>
</do>
</p>
</card>
</wml>

#WMLS SCRIPT FILE
    extern function check()
    {
    var num=Dialogs.prompt("Enter Number",0);
    var n=Lang.parseInt(num);
    var rev=0;
    var number=n;
    while(n>0)
    {
    var rem=n%10;
    rev=rem+rev*10;
    n=n div 10;
    }
    if(rev==number)
    {
    Dialogs.alert("It is palindrome Number");
    }
    else
    {
    Dialogs.alert("It is not palindrome Number");
    }
    }
   

WML program to find the reverse of given number.

#WML FILE
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="card1">
<p>
<do type="accept" label="Check Number">
<go href="prime.wmls#check()"/>
</do>
</p>
</card>
</wml>

#WMLS SCRIPT FILE 
  extern function check()
    {
    var num=Dialogs.prompt("Enter Number",0);
    var n=Lang.parseInt(num);
    var rev=0;
    var number=n;
    while(n>0)
    {
    var rem=n%10;
    rev=rem+rev*10;
    n=n div 10;
    }
    Dialogs.alert("The reverse of "+number+" is "+rev);
    }
   

Monday, November 7, 2016

WML program to find whether number is prime or not.

#WML FILE
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="card1">
<p>
<do type="accept" label="Check Number">
<go href="prime.wmls#check()"/>
</do>
</p>
</card>
</wml>


#WMLS SCRIPT FILE
    extern function check()
    {

    var num=Dialogs.prompt("Enter Number",0);
    var n=Lang.parseInt(num);
        if(n==1)
        {
        Dialogs.alert("It is prime number");
        }
        else{
        var c=0;
    for(var i=1;i<=n;i++)
    {
    if(n%i==0)
    {
    c=c+1;
    } 
    }
    if(c==2)
    {
    Dialogs.alert("It is prime Number");
    }
    else
    {
    Dialogs.alert("It is not a prime number");
    }
    }
    }

WML program to Find Odd or Even number using script

#WML File
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="card1">
<p>
<do type="accept" label="Check Number">
<go href="prime.wmls#check()"/>
</do>
</p>
</card>
</wml>

WMLS script File
extern function check()
{
var num=Dialogs.prompt("Enter Number",0);
var n=Lang.parseInt(num);
if(n%2==0)
{
Dialogs.alert("IT is even Number");
}
else
{
Dialogs.alert("It is odd Number");
}
}

Tuesday, October 25, 2016

WML PROGRAM SHOWING EXAMPLE OF TAG

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="one">
<p>
Username:<input type="text" name="use"/>

Password:<input type="password" name="pwd"/>
</p>
<do type="accept" label="login">
<go href="#two"/>
<setvar name="use" value="$(use)"/>
<setvar name="pwd" value="$(pwd)"/>
</do>
</card>
<card id="two">
<p>
hello $(use)
Your password is $(pwd)
</p>

<p>
   <anchor>
        <prev>back
           <setvar name="pwd" value=""/>
        </prev>
   </anchor>
</p>

</card>
</wml>

WML RPOGRAM SHOWING EXAMPLE OF NOOB TAG

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card title="Noop Element">
<p>
  <do type="prev" label="Back">
      <noop/>
  </do>
</p>
</card>
</wml>

Thursday, October 20, 2016

WML PROGRAM USING DO TASK ALONG WITH GO TAG

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">


<wml>


<card title="First Page" id="first">
<do name="Next" type="accept" label="Next">
<go href="#second"/>
</do>  
<p> This is first page </p>
</card>


<card title="Second Page" id="second">
<do type="accept" name="Back" label="Back">
<go href="#first"/>
</do>
<p> This is second page</p>
</card>


</wml>

On Key press event code, of Textbox to Accept digits only

1. drag a text box over the form
2. double click the textbox And change the event to key press event
3. right the following code in the key press event

 If Char.IsDigit(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then
            e.Handled = vbTrue
            MessageBox.Show("Enter digits only", "character press instead of number")
            TextBox1.Text = ""
            TextBox.Focus()
        End If
 
4. debug and try pressing character. it won't accept. it will accept only numbers


Explanation :

The "Char.IsDigit(e.KeyChar) = False " is the first condition That is been checked to verify what the
user's pressed if the user press a character (i.e not Digit)   then it will go for the second condition

"Char.IsControl(e.KeyChar) = False" this check's if what the user's pressed is control or not (i.e backspace, enter key e.t.c)

when this both conditions are satisfied then the condition becomes true , that the user pressed a character not a digit, number and not a control

the message box will be displayed to the user that the TextBox accepts digits only.
and then what ever is written in the textbox will be cleared and focus() will be return to the TextBox again.


Thank you

you can ask for more explanation if you felt to.

Saturday, October 15, 2016

WML program to create a Table

/*WML Program to Display Table*/
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORAM//DTD WML 1.2//EN"
"http:??www.wapforum.org/DTD/wml12.dtd">
<wml>
<card title = "WML Table">
<p>
<table columns="3" align="LCR" Border="1">
<tr>
<td>col1</td>
<td>col2</td>
<td>col3</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>D</td>
<td>E</td>
<td>F</td>
</tr>
</table>
</p>
</card>
</wml>

WML program to display Image of wbmp format

/*WML Program to Display Image*/
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORAM//DTD WML 1.2//EN"
"http:??www.wapforum.org/DTD/wml12.dtd">
<wml>
<card title = "Image">
<p>
This is an Image
<img src="info.wbmp" alt="info"?>
</p>
</card>
</wml>

WML program to display Splash screen using timer

/*WML Program to Display Timer*/
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORAM//DTD WML 1.2//EN"
"http:??www.wapforum.org/DTD/wml12.dtd">
<wml>
<card id="splash" title="splash">
<onevent type="ontimer">
<go href="#Welcome">
</onevent>
<timer value=50"/>
<p>
<a href="#Welcome">Enter</a>
</p>
</card>
<card id="Welcome" title="Welcome">
<p>
Welcome to the main screen
</p>
</card>
</wml>

WML program to display Image of wbmp format

/*WML Program to Display Image*/
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORAM//DTD WML 1.2//EN"
"http:??www.wapforum.org/DTD/wml12.dtd">
<wml>
<card title = "Image">
<p>
This is an Image
<img src="info.wbmp" alt="info"?>
</p>
</card>
</wml>

WML program to display different types of text format

/*WML Program for Displaying Different Types of Text*/
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORAM//DTD WML 1.2//EN"
"http:??www.wapforum.org/DTD/wml12.dtd">
<wml>
<card title="Text Formatting">
<p>
<b>bold Text</b><br />
<big>big Text</big><br />
<em>Emphasized Text</em><br />
                  <i>italic Text</i><br />
<small>small Text</small><br />
<strong>strong Text</Strong><br />
<u>underlined Text</u>
          </p>
</card>
</wml>

WML program to display number of card inside deck

<? xml version="1.0"?>
<wml>
<card id="one" title="First Card">
<p>
This is the first card in the deck
</p>
</card>
<card id="two" title="Second Card">
<p>
Ths is the second card in the deck
</p>
</card>
</wml>

Thursday, July 7, 2016

Programm using static data member,class and member functions , to check balance, deposit and withdraw in c++

/* wap a program using class named as Bank, with a static data member
and deposit,withdraw and check balance member functions to deposit and
withdraw or check balance respectively; apply conditions *
--ameer tataroo ameer, no copyrights.. do what ever you want to do with this
if you face any problem contact me on ameertataruu@gmail.com */
#include <iostream>
#include <iomanip>// for setw function
#include <conio.h>//for getch() function
#include <windows.h>//for system() function
using namespace std;
class bank
{
    static double amount_in;//i declared the static variable inside class
public :
    void withdraw()
    {
        system("cls");
        double withd;
        cout<<"how much amount do you want to withdraw\n";
        cin>>withd;
        if(amount_in>500)
        {
            amount_in = amount_in - withd;
        cout<<"\n you have successfully withdrawn "<<setw(10)<<withd;//setw(10)is used instead of \t
        cout<<"\n your remaining balance is "<<setw(10)<<amount_in;

        }
        else {
                cout<<"\n your current account balance is "<<setw(10)<<amount_in;
          cout<<"\n you should maintain minimum of "<<setw(10)<<amount_in;
        }
    }
    void deposit()
    {
        system("cls");
        double dep;
        cout<<"\n how much amount do you want to deposit "<<setw(10);
        cin>>dep;
              if(dep <= 5000)
              {
                  amount_in = amount_in + dep;
                  cout<<"\n amount successfully deposited and new balance is "<<setw(10)<<amount_in;
              }
              else {
                cout<<"\n sorry amount entered exceeds the limit ";
              }
    }
    void check()
    {
        cout<<"\n your current balance is "<<setw(10)<<amount_in;
    }
};
double bank::amount_in=500; //i defined the static variable which was defined in the class here
int main()
{
    system("title simple withdraw and deposit using static variable");
    bank b;
     char c,h;
   start : system("cls");
   cout<<"-----------welcome to bank management system---------";
     cout<<"\n\n\na.withdraw\tb.check balance\nc.deposit\n\n\n";
     c=getch();
     switch (c)
     {
     case 'a':
    b.withdraw();
    break;
     case 'b':
        b.check();
        break;
     case 'c':
        b.deposit();
        break;
     default:
        cout<<"\n\n-------wrong option terminating transaction-----\n";

     }
     cout<<"\n\n\n\t want to check balance or continue with another transaction ?(y/n)\n\n ";
     h=getch();
     if(h=='y'||h=='Y')
     {
         goto start;
     }

    return 0;
}

Wednesday, May 11, 2016

SQL PROGRAMS SHOWING THE MAJOR CONCEPTS OF JOINS

joins: combining the columns of two or more tables based on some attributes

types of joins:

cross:-
select * from customer_info1
cross join
order_info1

natural:-
select * from customer_info1
NATURAL join
order_info1


inner:-
returns rows when there is a match in both tables.

SELECT * FROM CUSTOMER_INFO1,ORDER_INFO1
WHERE CUSTOMER_INFO1.C_ID=ORDER_INFO1.C_ID

outer :-
 right outer:-
returns all rows from the right table, even if there are
no matches in the left table.

select * from customer_info1 right outer join order_info1
on customer_info1.c_id=order_info1.c_id

left outer:-
returns all rows from the left table, even if there are
 no matches in the right table.

select * from customer_info1 left outer join order_info1
on customer_info1.c_id=order_info1.c_id

full outer:-
 returns rows when there is a match in one of the tables.

select * from customer_info1 full outer join order_info1
on customer_info1.c_id=order_info1.c_id