0% found this document useful (0 votes)
35 views2 pages

JavaSE Assignments: Billing, Calculator, Patterns

The document outlines a series of JavaSE assignments focusing on various programming concepts such as control structures, arrays, and object-oriented programming. Assignments include creating applications for generating electricity bills, building a simple calculator, and implementing a bank application with multiple functionalities. Additional tasks involve string manipulation, pattern printing, and developing classes and interfaces for different scenarios.

Uploaded by

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

JavaSE Assignments: Billing, Calculator, Patterns

The document outlines a series of JavaSE assignments focusing on various programming concepts such as control structures, arrays, and object-oriented programming. Assignments include creating applications for generating electricity bills, building a simple calculator, and implementing a bank application with multiple functionalities. Additional tasks involve string manipulation, pattern printing, and developing classes and interfaces for different scenarios.

Uploaded by

jnaneswariganja
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Assignment 1: JavaSE application to generate Electricity bill (use if-else-if ladder)

inputs are old reading and current reading and generate the bill by following slabs/ranges: Scan the inputs using
Scanner class
0-50: Rs.1
50-100: Rs2
100-200: Rs.3
200-400: Rs.4
>400: Rs.5
example if the number of units are 120 then the consumption charge is (50*1)+(50*2)+(20*3)=Rs.210

Assignment 2: JavaSE application to make a Simple Calculator using switch...case


should be able to add, subtract, multiply and divide two numbers. Scan the two numbers and operator using
Scanner class.

Assignment 3: Java SE code that reads a set of integers, and then prints the sum of the even and odd integers
separately (use for loop)

Assignment 4: Print the following patterns (use for/while loop)

Assignment 5: (Using Arrays)


a)Find duplicate values in an array of integer values
b)Multiplication of two matrices (Use arrays and for loop)
c)Java program to find common elements between two arrays (string values)

Assignment 6: Bank Application. Bank Employees have to get the menu with internal options
1. Account Creation (scan customer details name, aadhar number and pan)
2. Credit Amount (account number and amount)
3. Debit Amount (account number and money)
4. Mini statement/balance enquiry
5. Transfer account (from account number, to account number, amount)
6. Continue (y/n)
Upon selecting the option the respective operation has to be performed with a success message returned and
repeat the menu. (Use all Control structures that are applicable, variables/arrays)

Assignment 7: JavaSE application to check whether the given String is Palindrome or not (use String only).

Assignment 8: Given a string and it contains the digits as well as non-digits. We have to find the largest even
number from available digits after removing the duplicates. If not possible, print -1. (For a given string ad
%#2373#@ the output is 732)

Assignment 9: Program to print all prime numbers between 1 to n, only if it is part of the Fibonacci series. For
example: n value is 10, 1 to 10 prime numbers are : 2, 3, 5, 7. Fibonacci series : 0, 1, 1, 2, 3, 5, 8, 13, 21.. output
is: 2,3,5

Assignment 10: Program to implement the following. A Boy has his money deposited $1000, $1500 and $2000 in
banks-Bank A, Bank B and Bank C respectively. We have to print the money deposited by him in a particular bank.
Create a class 'Bank' with a method 'getBalance' which returns 0. Make its three subclasses named 'BankA',
'BankB' and 'BankC' with a method with the same name 'getBalance' which returns the amount deposited in that
particular bank. Call the method 'getBalance' by the object of each of the three banks.

Assignment 11: create an interface named Bank with the services (use proper input parameters and return types)
- create account, credit amount, debit amount, transfer amount, mini statement and with fixed rate of interest.
Provide two implementation classes SBI, Axis with necessary implementations. Use Late binding to create
respective objects and call the methods.

Assignment 12: create an interface named Restaurant. create a method that will print the name of the restaurant
when called. Create an abstract method called addItem which adds the Item objects to the menu (item array).
create an abstract method named getmenu which returns an item array. create an abstract method placeOrder to
generate order. create an abstract method named generateBill which takes orderid and returns totalAmount with
6% tax. create a class called KFC that implements Restaurant. (Create Item and Order bean classes having
required data)

Assignment 13: Create an abstract class named Shape that contains two integers and an
empty method named printArea(). Provide three classes named Rectangle, Triangle, and
Circle such that each one of the classes extends the class Shape. Each one of the classes
contains only the method printArea() that prints the area of the given shape.

You might also like