Acquire a Knowledge of Java Programming Language
Hello Guys🤙
In Our Previous Block, We Have Seen the Basics of Java Programming and Some Simple Programs.
In today's Blog We will Create a Basic Project in Java Programming Language.
With the Help of Java Program Using the Length and Breadth of the House. We Can Easily Find Out the Area of The House and How Many Tiles Are to Be Installed in That House and the Cost of Installation and Cost of Wiring in the House.
Program - Basic Project
import java.io.*;
import java.util.Scanner;
class Project {
public static void main(String args[ ])
{
Scanner obj = new Scanner(System.in);
int l,b,a,tl,tb,ta,x,p;
p=1;
int la,o,wire,pr,g,lb,h,me;
char ch;
System.out.print("Enter Your House Length= ");
l = obj.nextInt( );
System.out.print("Enter Your House Bregth= ");
b = obj.nextInt( );
a = l * b;
System.out.println("Area of House="+a+"sq.");
System.out.println("Select Tiles Price(per/sq)");
System.out.println("A - Black-Marbel 150/sq");
System.out.println("B - Kota Stone 100/sq");
System.out.println("C - Granite 200/sq");
System.out.println("D - White-Marbel 250/sq");
System.out.print("Select Any Tiles in Form of A,B,C Or D = ");
ch = obj.next( ).charAt(0);
System.out.print("Enter Length of Tiles= ");
tl = obj.nextInt( );
System.out.print("Enter Breagth of Tiles= ");
tb = obj.nextInt( );
ta = tl * tb;
System.out.println("Area of Tiles= "+ta+"sq");
x = (a/ta);
System.out.println("Tiles Using In House= "+x);
if (ch=='a'||ch=='A')
{
p = x*ta*150;
System.out.println("Price of Tiles Using In House="+p);
}
else if (ch=='b' || ch=='B')
{
p = x*ta*100;
System.out.println("Price of Tiles Using In House="+p);
}
else if (ch=='c' || ch=='C')
{
p = x*ta*200;
System.out.println("Price of Tiles Using In House="+p);
}
else if (ch=='D' || ch=='d')
{
p = x*ta*250;
System.out.println("Price of Tiles Using In House="+p);
}
else
{
System.out.println("Select Correct Character");
}
System.out.print("Enter Tiles Labour price Per Square Feet= ");
la = obj.nextInt( );
o = la * a;
System.out.println("Labour Charge= "+o);
o = o+p;
System.out.println("Installation of Tiles Total Expense = "+o);
System.out.print("How many square feet of wire Do you want to install in your house? =" );
wire = obj.nextInt( );
System.out.print("Price of wire Per square Feet = ");
pr = obj.nextInt( );
g = wire*pr;
System.out.println("Wire Charge or price = "+g);
System.out.print("Labour Charge to Install Wire in House Per/sq. Price= ");
lb = obj.nextInt( );
h = wire*lb;
System.out.println("Labour Charge = "+h);
h = h+g;
System.out.println("Total Expense to Install wire in House = "+h);
me = h+o;
System.out.println("Total Expense in House= "+me);
}
}


Comments
Post a Comment