Program 1
Program 1
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 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
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
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:
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: