Saturday, 17 November 2018

jQuery is not Working :: Solution

Some times for new beginners of jQuery faces problem regarding jQuery that's not working, as I'd faced it many years ago and some of people asked me that question. So here are the some of the solutions regarding this problem:

1. Make sure jQuery library is properly linked with your web page
2. Sometimes linking multiple jQuery files (such as different versions of jQuery) may also cause problem in working properly
3. Make sure you are not having any syntax error, such as missing brackets or have extra brackets
4. Try different browsers
5. Clear browser's cache from setting option or you may use short cut (ctrl+f5) to clear cache

Hope it may help you out regarding jQuery problem.

Tuesday, 20 September 2016

Android Based Multi-Shop Fast Food Order System

This Android based project will help users to order their favorite fast food from their favorite food chain in a single application and also can compare the price of same products of different companies.
This System can also be called as `Price Comparing System`, not Limited to Fast Food, `Anything Order System` and so on...

Switch Statement Example in Java Swing Package

import javax.swing.JOptionPane;
    class Switch{
        public static void main(String[]args) throws Exception{
            String input = JOptionPane.showInputDialog("Enter");
            int percentage = Integer.parseInt(input);
        switch(percentage){
            case 90:
                JOptionPane.showMessageDialog(null, "A+ Grade");
                    break;
            case 80:
                JOptionPane.showMessageDialog(null, "A Grade");
                    break;
            case 70:
                JOptionPane.showMessageDialog(null, "B Grade");
                    break;
            case 60:
                JOptionPane.showMessageDialog(null, "C Grade");
                    break;
            case 50:
                JOptionPane.showMessageDialog(null, "D Grade");
                    break;
            case 40:
                JOptionPane.showMessageDialog(null, "IMPROVED");
                    break;
            default:
                JOptionPane.showMessageDialog(null, "Fail");
               
        }
        }
    }

Marksheet In Else-If Statement Java Program Swing Package

import javax.swing.JOptionPane;
    class IfElseMarksheet{
        public static void main(String[]args) throws Exception{
            String a = JOptionPane.showInputDialog("Enter Java Marks");
            int java = Integer.parseInt(a);
            String b = JOptionPane.showInputDialog("Enter PHP Marks");
            int php = Integer.parseInt(b);
            String c = JOptionPane.showInputDialog("Enter VB Marks");
            int vb = Integer.parseInt(c);
            String d = JOptionPane.showInputDialog("Enter C++ Marks");
            int cpp = Integer.parseInt(d);
            String e = JOptionPane.showInputDialog("Enter Ruby Marks");
            int ruby = Integer.parseInt(e);
           
            int total = 500;
            int obtained = java + php + cpp + vb + ruby;
            int percentage = obtained * 100 / total;
           
            if(java >39){
                if(php > 39)
                if(vb >  39)
                if(cpp > 39)
                if(ruby > 39)
                if(percentage < 100)
                if(percentage >= 80)
               
JOptionPane.showMessageDialog(null, "Total Marks Are :" + total +
                 "\n Obtained Marks Are : " + obtained +
                 "\n Percentage is : " + percentage +"%" +
                 "\n You Are Pass" + "\n You Got A+ Grade");
}
       
           else if(java >39){
                if(php > 39)
                if(vb >  39)
                if(cpp > 39)
                if(ruby > 39)
                if(percentage <  80)
                if(percentage >= 70)
               
JOptionPane.showMessageDialog(null, "Total Marks Are :" + total +
                 "\n Obtained Marks Are : " + obtained +
                 "\n Percentage is : " + percentage +"%" +
             
                              "\n You Are Pass" + "\n You Got A Grade");
}
           
           else if(java >39){
                if(php > 39)
                if(vb >  39)
                if(cpp > 39)
                if(ruby > 39)
                if(percentage <  70)
                if(percentage >= 60)              
JOptionPane.showMessageDialog(null, "Total Marks Are :" + total +
                 "\n Obtained Marks Are : " + obtained +
                 "\n Percentage is : " + percentage +"%" +
                 "\n You Are Pass" + "\n You Got B Grade");
}
           
           else if(java >39){
                if(php > 39)
                if(vb >  39)
                if(cpp > 39)
                if(ruby > 39)
                if(percentage <  60)
                if(percentage >= 50)              
JOptionPane.showMessageDialog(null, "Total Marks Are :" + total +
                 "\n Obtained Marks Are : " + obtained +
                 "\n Percentage is : " + percentage +"%" +
                 "\n You Are Pass" + "\n You Got C Grade");
}
           
           else if(java >39){
                if(php > 39)
                if(vb >  39)
                if(cpp > 39)
                if(ruby > 39)
                if(percentage <  50)
                if(percentage >= 40)              
JOptionPane.showMessageDialog(null, "Total Marks Are :" + total +
                 "\n Obtained Marks Are : " + obtained +
                 "\n Percentage is : " + percentage +"%" +
                 "\n You Are Pass" + "\n You Got D Grade");
}

            else{
                JOptionPane.showMessageDialog(null, "Total Marks Are :" + total +
                 "\n Obtained Marks Are : " + obtained +
                 "\n Percentage is : " + percentage +"%" +
                 "\n You Are Fail");
}

        }
    }

Wednesday, 7 September 2016

Operator Selector Calculator Java Program

Operator Based Calculator Using Swing Package



import javax.swing.JOptionPane;
    class OperatorCalc{
        public static void main(String[]args){
            String operator = JOptionPane.showInputDialog("Enter any Operator" );
            String op = operator;
           
            String v1 = JOptionPane.showInputDialog("Enter First Value" );
            int value1 = Integer.parseInt(v1);
           
            String v2 = JOptionPane.showInputDialog("Enter Second Value" );
            int value2 = Integer.parseInt(v2);

   
    if (!(op == "+" || op == "-" || op == "*" || op == "/" || op == "%" ))
        JOptionPane.showMessageDialog(null, " Enter a valid Operator");
           
           
    if( op == "+" )
        JOptionPane.showMessageDialog(null, " Addition is " + (value1 + value2) );
           
    if( op == "-" )
        JOptionPane.showMessageDialog(null, " Subtraction " + (value1 - value2) );
           
    if( op == "*" )
        JOptionPane.showMessageDialog(null, " Multiplication is " + (value1 * value2) );
           
    if( op == "/" )
        JOptionPane.showMessageDialog(null, " Division is " + (value1 / value2) );
           
    if( op == "%" )
        JOptionPane.showMessageDialog(null, " Reminder is " + (value1 % value2) );
           
        }
    }

Menu Based Calculator Java Program

GUI Based Menu Calculator Using Swing Package



import javax.swing.JOptionPane;
    class MenuCalc{
        public static void main(String[]args) throws Exception{
            String select = JOptionPane.showInputDialog( "Enter Number 1-5" +
                                                        "\n 1 == Addition " +
                                                        "\n 2 == Subtraction " +
                                                        "\n 3 == Multiplication " +
                                                        "\n 4 == Division " +
                                                       "\n 5 == Reminder ");
            int Menu = Integer.parseInt(select);

            String v1 = JOptionPane.showInputDialog( "Enter First Value ");
            int value1 = Integer.parseInt(v1);
           
            String v2 = JOptionPane.showInputDialog( "Enter Second Value ");
            int value2 = Integer.parseInt(v2);
           
            if(Menu == 1)
            JOptionPane.showMessageDialog(null, value1 + value2);
       
            if(Menu == 2)
            JOptionPane.showMessageDialog(null, value1 - value2);

            if(Menu == 3)
            JOptionPane.showMessageDialog(null, value1 * value2);
       
            if(Menu == 4)
            JOptionPane.showMessageDialog(null, value1 / value2);

            if(Menu == 5)
            JOptionPane.showMessageDialog(null, value1 % value2);
       
            if(!( Menu == 1 || Menu == 2 || Menu == 3 || Menu == 4 || Menu == 5))
            JOptionPane.showMessageDialog(null, " Enter Valid Menu ");
       
        }
    }

Billing System Java Program

Java Program Billing System According to Units Using `util` Package


import java.util.Scanner;
    class HESCOBill{
        public static void main(String[]args) throws Exception{
            Scanner s = new Scanner(System.in);
            System.out.print(" Enter Units ");
                String bill = s.nextLine();
                int units = Integer.parseInt(bill);
            if( units >= 1 && units <=100 )
                System.out.print("Your bill is " + units * 2 );
            if( units > 100 && units <=200 )
                System.out.print("Your bill is " + units * 4 );
            if( units > 200 && units <= 300 )
                System.out.print("Your bill is " + units * 6 );
            if( units > 300 && units <= 400 )
                System.out.print("Your bill is " + units * 8 );
            if( units > 400 )
                System.out.print("Your bill is " + units * 10 );
        }
    }