Posts

Showing posts from April, 2020

Marquee Tag in Html and Properties of Marquee Tag with Html Code

<!DOCTYPE html> <html> <head> <title>Marquee Tag Example</title> </head> <body> <marquee behavior="scroll" scrollamount="10" direction="right" loop="3">Welcome To Coding Hub</marquee> </body> </html>

LIST Tags in Html

<!DOCTYPE html> <html> <head> <title>Example of List</title> </head> <body> <center><h1>Type of List</h1></center> <!--Order list--> <ol type=a> <li>Ajit</li> <li>Sahbaj</li> <li>Pawan</li> </ol> <ol type=A> <li>Ajit</li> <li>Sahbaj</li> <li>Pawan</li> </ol> <ol type=i> <li>Ajit</li> <li>Sahbaj</li> <li>Pawan</li> </ol> <ol start="10"> <li>Ajit</li> <li>Sahbaj</li> <li>Pawan</li> </ol>   <!--Unorder List--> <ul type="square">     <li>Ajit</li> <li>Sahbaj</li> <li>Pawan</li> </ul> <!--Defination List--> <dl> <dt>Ajit</dt> <dd>he is game De

A Computer Salesman gets commission on the following basis using Java

/*A computer salesman gets commission on the following basis:             Sales                        Commission Rate             Rs. 0 - 20,000                      3%             Rs. 20,000 - 50,000                12%             Rs. 50,001 and more                31% After accepting the sales as input, calculate and print his commission amount and rate of commission.*/ Source code: import java.util.*; class Comm {     public static void main(String args[])     {         double comm=0.0;         int rate=0,sale;         Scanner sc=new Scanner(System.in);         System.out.println("Enter the sales rs:");         sale=sc.nextInt();         if(sale<=20000)         {             rate=3;             comm=sale*0.3;         }         if(sale>=20000 && sale<=50000)         {             rate=12;             comm=sale*0.12;         }         if(sale>=50000)         {             rate=31;             comm=sale*0.31;         }  

Electricity Bill Program:Write a program in JAVA to enter the unit and calculate the amount to bill paid by user

Calculate the Bill as per the following tariff : Number of units Rate per unit 1 - 100 units Rs.5.00 101-200 units Rs.7.00 201-300 units Rs.10.00 Above 300 Rs:15.00 Before we write a program to calculate the electricity bill we must understand electricity charges and rates. /*1 - 100 unit - 5/= 101-200 unit - 7/= 201-300 unit - 10/= above 300 - 15/=*/ Explanation if the unit consumed less or equal to 100 units, calculates the total amount of usage =unit*5 if unit consumed between 100 to 200 units, calculates the total amount of usage =(100*5)+(unit-100)*7) if unit consumed between 200 to 300 units ,calculates total amount of usage =(100*5)+(100*7)+(unit-200)*10 if unit consumed above 300 units ,calculates total amount of usage =(100*5)+(100*7)+(100*10)+(unit-300)*15 No additional charge Source code import java.util

Wap to enter a number and Decide whether the number is Buzz number or Not using Java

This program checks if a number entered is a Buzz Number or not in JAVA. A number is said to be Buzz Number if it ends with 7 or is divisible by 7. Example- 21,67,77 import java.util.*; public class Buzz {     public static void main(String args[])     {         Scanner sc=new Scanner(System.in);         System.out.println("Enter the number to be checked.");         int num=sc.nextInt();         if(num%10==7 || num%7==0)         {             System.out.println(num+" is a Buzz Number.");         }         else         {             System.out.println(num+" is not a Buzz Number.");         }     } } Enter the number to be checked. 77 77 is a Buzz Number.

Wap to enter the length and breadth of a rectangle and print area and perimenter

import java.util.*; class Rectangle {         public static void main(String args[])         {             int l,b,ar,p; // local variable             Scanner sc=new Scanner(System.in);             System.out.println("Enter length and breadth");             l=sc.nextInt();             b=sc.nextInt();             ar=l*b;             p=2*(l+b);             System.out.println("Area="+ar);             System.out.println("perimeter="+p);         }     }                 Enter length and breadth 10 20 Area=200 perimeter=60

Wap to enter the side of and print area and perimenter in Java

import java.util.*; class side {     public static void main(String args[])     {         int s,ar,pm; //variable         Scanner sc=new Scanner(System.in);         System.out.println("Enter the side");         s=sc.nextInt();         ar=s*s;         pm=4*s;         System.out.println("Area="+ar);         System.out.println("Perimenter="+pm);     } } Output: Enter the side 10 Area=100 Perimenter=40