You are on page 1of 3

Course Code : CSE2008 Course Title : Programming in java Lab

sheet 2

Programs for Module 2

1. XYZ shopping mall wants to distribute lucky coupon for its customers. Each lucky
coupon has some prize amount. The mall executive wants to pick 100 order numbers
randomly. The order number lies between 1000 and 9999. Design a java application
which helps the executive to determine the winners of lucky coupon. The customer is
winner if order number is palindrome and if it belongs to those 100 randomly picked one.

Output
The customer with order number 4224 won the lucky coupon
The customer with order number 8888 won the lucky coupon

2. Mr Ram has gathered the requirements of sports accessories for Team A and Team B
as shown below. The cost of sports accessories are given as below. Design a java
application to find the total cost of accessories for Team A and Team B separately

Teams Balls Bats Gloves

Team -A 12 45 15
Team -B 15 38 17

Equipment Cost
Name
Balls 9$
Bats 80$

Gloves 60$
Output
Enter the quantity of balls, bats and gloves for Team1
234
Enter the quantity of balls, bats and gloves for Team2
124
The total bill for Team A and Team B is as follows
For Team A 498
For Team B 4609

3. Mr John is working as data entry operator in company XYZ. He wants to gather the
information about the new employees joining the organization. Design a java
application to read and display the information about n employees.

Output

Enter the number of employees


2
Enter details of Employee 1
Enter Employee Id :
111
Enter Employee Name :
ram
Enter Employee Age : 33
Enter Employee Salary :
45000 Enter details of
Employee 2 Enter Employee
Id :
222
Enter Employee Name :
Sham
Enter Employee Age : 45
Enter Employee Salary : 78800
Details of Employees
111 ram 33 45000
222 Sham 45 78800
4. Mr John is office executive in Engineering college. He wants to count the number of
admissions on each day branch wise. Design a java application which counts the number
of students admitted in CSE, ISE and ECE branch depending upon the roll number
allocated to the student. The format of roll number is as follows. Example :
20221CSE001.

RollNumber Format : year-1-branch name-last three digits of roll

number

Output

Enter the roll number of 10 students


20221cse001
20221cse002
20221cse003
20221cse004
20221cse005
20221cse006
20221CSE007
20221ece001
20221ece002
20221ise200
Total CSE students 7
Total ISE students 1
Total ECE students 2

5. XYZ bank wants to generate a 16 digit transaction password for the customers during
each transaction. The transaction password is constructed based on the username and
some random digits. Design a java application which generates a 16 digit transaction
password using following rule Note : Transaction Password = first half of user name
+ random digits + second half of user name and total length of Transaction Password
is 16. The entered username should not contain any blank spaces.

Output

Enter username :
reshmashet
Length of username is 11
16 digits transaction password is : resha68585mashet

You might also like