0% found this document useful (0 votes)
16 views3 pages

Program 1

The document outlines five programming tasks involving Java, each requiring the use of switch cases and methods. Tasks include designing a pattern printer, creating an employee management system, performing arithmetic on large numbers, simulating an ATM, and developing a restaurant ordering system. Each task specifies input formats, operations to be performed, and expected outputs, emphasizing the use of object-oriented programming concepts where applicable.

Uploaded by

ankitpcm1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Program 1

The document outlines five programming tasks involving Java, each requiring the use of switch cases and methods. Tasks include designing a pattern printer, creating an employee management system, performing arithmetic on large numbers, simulating an ATM, and developing a restaurant ordering system. Each task specifies input formats, operations to be performed, and expected outputs, emphasizing the use of object-oriented programming concepts where applicable.

Uploaded by

ankitpcm1114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Program 1.Design a switch case to print pattern program.

For each pattern you must create a method and call-in switch cases.

Case 1:

Case 2:

Case 3:

Program 2. Design a class Employee Manager Where you have to create two method

1. void person (String name, String designation, double salary, double baseSalary)

2. void manager (String name, String designation, double salary, double baseSalary)

Create a EmployeeDriver class where you will have main method

Create switch case where you have to display 1. add manager 2. add person

After adding both details you have to find the 8 % of manager salary and 3% of person salary

After this if manager salary is greater than person salary then add manager salary in person salary

And find the 19% of person salary.

In switch case case 3. is to display updated salary of person and display all details

In switch case case 4. is to display updated salary of manager and display all details.

Note: if you will use oops concept that will be advantage or by simple methods is also ok.
Program 3. In this problem, you have to add and multiply huge numbers! These numbers are so big
that you can't contain them in any ordinary data types like a long integer.

Input Format

There will be two lines containing two numbers a and b.


Constraints
a and b are non-negative integers and can have maximum digits.
Output Format
Output two lines. The first line should contain a + b and the second line should contain a*b. Don't
print any leading zeros.
Sample Input
12345
45
Sample Output
12390
555525

Note: from output you must remove all even number and zeros so here your final
output will be:
139
55555

Program 4:
Creating a Java scenario for an ATM (Automated Teller Machine) involves simulating
common ATM actions, such as checking an account balance, making deposits, and
withdrawing money. Here's a simplified Java program using methods to represent an ATM
scenario:

Create a switch case :


1.Enter your card with your pin code
2.CheckBalance
3.Deposit
4.Withdrawl
5.Display Current balance

Note: After withdrawing money, please update the balance.

This Java program simulates an ATM scenario. Users can check their balance, make
deposits, and withdraw money. The program runs in a loop until the user chooses to exit. It
demonstrates the use of methods for encapsulating ATM actions and provides a simple menu
system for user interaction
Program 5:
Certainly! Let's create a scenario for a simple restaurant ordering system using Java
methods and a switch-case statement. In this scenario, a customer can choose items from a
menu, place their order, and calculate the total bill. Here's the Java code for this restaurant
scenario:

1. add menu details

2.Display menu details:


a. Burger 25 rupees
b. Pizza 150 rupees
c. Salad 10 rupees
d. Chicken biryani 150 rupees
e. Chicken chilli 60 rupees
f. Veg Thali 100 rupees
3. Please order:
You can order a number of items.
4. My order details can be displayed on your console. With final price

Note: above scenario you have to create with java methods:

You might also like