Experimen Inter Net
Experimen Inter Net
A.1. Aim/Overview of the practical: Write a program that would print the
information (name, year of joining, salary, address) of three employees by creating a
class named 'Employee'. The output should be as follows:
Name Year of joining Address
Robert 1994 64C- WallsStreat
Sam 2000 68D- WallsStreat
John 1999 26B- WallsStreat
A.2.Algorithm:
year=y; addr=a;
}
void display()
{
System.out.println(name+"\t\t"+year+"\t\t"+addr);
}
};
class Exp1
{
public static void main(String[] args) { System.out.println("Name"+"\t\t"+"Year of Joining"+"\t\t"+"Address");
Employee e1=new Employee("Robert",1994,"64C-WallsStreat"); Employee e2=new Employee("Sam",2000,"68D-
WallsStreat"); Employee e3=new Employee("John",1999,"26B-WallsStreat");
e1.display();
e2.display();
e3.display();
}
}
A.4.Result/Output/Writing Summary:
B.1. Aim/Overview of the practical: Write a program to demonstrate the working of a banking
system where we deposit and withdraw amount from our account. Create function which
performs deposit transactions and one which perform withdraw transactions.
B.2.Algorithm:
int balance=0;
balance=balance+amount;
if(amount<balance)
balance=balance-amount;
else
int choice=0;
while(choice<3)
choice= obj.nextInt();
switch(choice)
case 1:
bank.deposit(depositeAmount);
break;
case 2:
break;
B.4.Result/Output/Writing Summary:
Learning Outcomes:
i. I got to know about Java and its Syntax.
ii. About Java Class.
iii. About Scanner Package.
iv. Switch Case Implementation in Java.