Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Course pack Java Programming

Uploaded by

suiiisimon0
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Course pack Java Programming

Uploaded by

suiiisimon0
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

COURSE CONTENT

(THEORY + PRACTICAL)

Introduction to OOPS and Fundamentals of Java Programming:


Introduction - Object oriented concept- class, object. Object oriented properties- Encapsulation, Inheritance,
abstraction, polymorphism. History-Java and the Internet-Java Applets and Applications, Features of Java,
Java Virtual Machine (JVM), Java Runtime Environment-JRE, Byte-Code , JAVA buzzwords,
Command Line Arguments, Java program structure, Reserved keywords, Identifiers, Literals,
Operators, Separators, Variables, Declaring a variable, Scope and lifetime of variables, Data types, Type
conversion, casting.

Language Basics:
Loops and Control Statement: If-else, switch case, Loops in Java. Arrays: One-Dimensional Arrays,
Two-dimensional Array, Vectors, Operators-Arithmetic, Boolean logical, Relational and Bitwise
Operators-Operator Precedence. Class: Fundamentals, The General Form of a Class, Object
Declaration, Assigning Object Reference Variables, Methods: Overloading Methods, Using Objects as
Parameters, Access Specifiers in Java. A Closer Look at Argument Passing, Returning Objects, Recursion
Introducing Access Control, Final Variables and Methods, Final class, Finalize Methods, Abstract Methods
and Class, Visibility Control, Constructors -type of constructor, its usage , constructor overloading

String Handling, Inheritance and Java Packages:


String: Strings, Different string functions and their use, String conversion. Method Overloading, Use of final
keywords, Using final to Prevent Overriding. Wrapper class and inner class concepts, and programming with
wrapper class and inner class. Inheritance: Types of Inheritance, Member Access, creating a Multilevel
Hierarchy, using final to Prevent Inheritance, Packages and Interfaces: How to create a package, use of
packages. Interface: Defining interface, use of interface, creating an interface, difference between abstract
class and interface.

Exception Handling & Multithreading:


Exception Handling: Exceptions and error, Exception hierarchy, Try, Catch, Finally, Throw, Throws.
The Java thread model- Thread priorities, Thread Lifecycle, synchronization, Messaging, The thread class,
and Interface. The Main Thread, Creating a Thread- Implementing Runnable, Extending Thread, Creating
Multiple Threads, Using isAlive(),

Java Input / Output, File


Java I/O package for File Management-I/O Basics-Reading console Input-Writing console output
Print Writer Class-Reading and Writing Files-Java I/O classes,

LESSON PLAN FOR COMPREHENSIVE COURSES


FOR THEORY 15 weeks * 3 Hours = 45Classes) (1credit = 1 Lecture Hour)
FOR PRACTICAL 15 weeks * 2Hours = 30 Hours lab sessions (1 credit = 2 lab hours)
FOR COURSE - BASED PROJECT 15 weeks * 3 Hours = 45 Hours lab sessions
(1 credit = 3 self-learning hours) (Not to mention in lesson plan)

LectureNo Topic for Theory /


Skills Competency COURSEPACK |
Teaching
Delivery Tutorial /
Practical
Plan Pedagogy
1 Introduction - Theory Active Listening Critical White Board
Object-oriented and Thinking Teaching and
concept- class, understandability Video
object. Object- skill Demonstration
oriented
properties-
Encapsulation,
Inheritance,
abstraction,
polymorphism.\

2 History-Java and Theory White Board


the Internet-Java Teaching, Quiz
Applets and through Online
Applications, platform
Features of
Java, Java
Virtual
Machine
(JVM), Java
Runtime
Environment-
JRE, Byte-Code
,JAVA
buzzwords

3 Command Line Theory White Board


Arguments, Teaching, Quiz
Java program through Online
structure, platform
Reserved
keywords

4 Identifiers, Theory White Board


Literals, Teaching and
Operators, Question and
Separators, Answer Session
Variables,
Declaring a
variable, Scope
and lifetime of
variables,
5 Data types, Type Practical Analytical skill Critical thinking White Board
conversion, and problem- and analytical Teaching,
casting solving skill ability Practical
Demonstration
6 Control Practical White Board
Statement: if, If- Teaching,
else, nested if, Practical
else if ladder Demonstration
COURSEPACK |
7 Break, continue, Theory White Board
switch case Teaching,
Practical
Demonstration,
Quiz through
Online platform
8 Loops in Java- Theory White Board
Do, while, Do- Teaching,
While, For Activity of
loops problem solving
through loops
9 Arrays: One- Theory White Board
Dimensional Teaching, Quiz
Arrays
10 Two- Theory White Board
dimensional Teaching, Quiz
Array, Vectors

11 Operators- Practical Analytical skill Critical thinking Practical


Arithmetic, and problem- and analytical Demonstration,
Boolean solving skill ability Students hands
logical, on participation
Relational and
Bitwise
Operators-
Operator
Precedence.

10 Class: Theory White


Fundamentals BoardTeaching,
, The General Real life example
Form of a
Class, Object
Declaration,
Assigning
Object
Reference
Variables
11 Methods: Using Theory White
Objects as BoardTeaching,
Parameters, Real life
Access example, quiz
Specifiers in through Online
Java. A Closer platform
Look at
Argument
Passing,
Returning
Objects
12 Recursion Practical Practical
Introducing Demonstration,
Access Control students hands-
on and COURSEPACK |
competition
13 Method Theory White Board
Overloading Teaching,
Problem-solving
by students
14 Final Variables Theory White Board
and Methods, Teaching, Quiz
Final class, during class
Finalizer
Methods, Abstract
Methods and
Class
15 Concept of Theory Whiteboard
wrapper class- teaching,
what is wrapper students’ Group-
class, need and wise activity of
usage of wrapper framing a
class, advantages
problem
and disadvantages
etc.
16 Programming Practical Whiteboard
with wrapper teaching,
class students’ Group-
wise activity of
framing a
problem
17 Concept of inner Theory Problem solving Assessment and Practical
class- definition, and analytical skill critical thinking Demonstration,
advantages, Quiz during class
types of inner
class
18 Programming Practical Practical
with inner class Demonstration
and students'
hands-on
19 Visibility Control, Theory Whiteboard
Constructors- teaching,
definition, types, students’ Group-
wise activity
20 constructor Theory Whiteboard
overloading teaching, quiz
through online
platform
21 String: Strings, Theory Whiteboard
Different string teaching, student
functions and activity
their use, String
conversion

22 Method Practical Practical


Overloading, Use Demonstration,
of final keywords, Students’ hands-
Using final to on
COURSEPACK |
Prevent Overriding
23 Inheritance: Practical Problem-solving Technical Practical
Types of and analytical competency and Demonstration,
Inheritance, skills design thinking Students
Member Access, Discussion
Forum
24 creating a Theory Whiteboard
Multilevel teaching,
Hierarchy, using Students
final to Prevent Discussion
Inheritance Forum
25 Packages and Theory Whiteboard
Interfaces: How Teaching and
to create a Quiz through an
package, online platform
26 How to create a Practical Practical
package, type of Demonstration,
package and use of Students’ hands-
packages on
27 Use of package Practical Practical
for access Demonstration,
control Students’ hands-
on
28 Interface: What is Theory Whiteboard
an interface, why Teaching and
to use, creating an Quiz through an
interface, online platform
difference between
abstract class and
interface
29 Exception Theory Analytical skill Technical Whiteboard
Handling: What is and development competency and Teaching,
Exception, Error skill critical thinking Student
and Exception, presentation
Type of Exception
30 Exception Theory Whiteboard
Hierarchy, Use Teaching, Quiz
of Try, catch
31 Exception Practical Practical
Handling Finally, Demonstration,
Throw, Throws Students’ Hands-
on
32 The Java thread Practical Practical
model- Thread Demonstration,
priorities, Thread Students’ Hands-
lifecycle, on
synchronization,
Messaging, The
thread class and
Interface.
33 The Main Thread, Theory Whiteboard
Creating a Teaching, Quiz
Thread- through anCOURSEPACK
online |
platform
34 Implementing Theory Whiteboard
Runnable, teaching,
Extending Thread, Question and
Creating Multiple answer session
Threads
35 Testing the Theory Teamwork, Technical Whiteboard
properties of Analytical skills competency, Teaching, Quiz
thread and problem- critical thinking during class
36 Java I/O Practical solving skill Practical
package for File Demonstration,
Management- Student Hands
I/O Basics- On
Reading console
Input-Writing
console output
37 The concept of Theory Whiteboard
files in Java Teaching, Real-
life example
38 Print writer Theory Demonstration
class
39 Reading and Theory Whiteboard
Writing a file in Teaching, Video
Java presentation
40 Reading, Practical Practical
writing in a file, Demonstration,
Students hands-
on
41 copying data Practical Practical
from one file to Demonstration,
another Students hands-
on
42 Revision Theory Students query
solving and
student
presentation
43 Revision Theory Students query
solving and
student
presentation
44 Revision Theory Students query
solving and
student
presentation
45 Revision Theory Question and
Answer session

List of Practicals of java programming


S. Program
N COURSEPACK |
o
1 Write a program that will print a "hello java" message on the screen
2 Write a program to read an integer from the command line and calculate square root of that value.

3 Write a program to read an integer value through Scanner class and check whether it is
even or odd.

4 Write a program to read an integer value through Scanner class and swap the value i)
with using a third variable
ii) Without using a third variable.

5 Write a program to find factorial of a number with recursion and iteration


6 Java IO program to take input through keyboard at runtime.
7 Write a program to reverse a number and count the sum of digit
8 Write a Java program to Print Sum of Series 1+x+x2+x3+......+xn in java
9
Write a program to display the following pattern:

12
123
1234
12345
10
Write a java program to create patterns
*
**
***
****
11 Write a program to display the following pattern:
*********
*******
*****
***
*
12 Write a Java Program to Make a Simple Calculator Using
switch...case and Scanner class.
13 Write a program to Search an Element in a
one dimensional Array in java.
14 Write a program to add two matrices of order 3X3
15 Create a class Student (name, roll_no, marks) with one method show() and initialize instance variables using all
the ways: reference, method and constructor.
16 Write a java code to implement the concept of method overloading.
17 WAP implementing Constructor overloading and use this key word in overloading.
18 Write a program to book a ticket using static keywords
19 Write a java code to implement the concept of simple inheritance, multilevel inheritance, and hierarchical
inheritance
20 Create 2 packages P1 & P2 and create classes Student and BCA in P1 and P2 respectively. Check the
accessibility using all the access modifiers.
COURSEPACK |
21 WAP to implement 3 interfaces and extend one class.
22 Implement multiple inheritance in java using interface.
23 Write a Java program to create an abstract class named Shape that contains two integers
and an empty method named print Area ().
24 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 print Area () that prints the area of the given
shape.
25 Write a program to demonstrate operator overloading
26 Write a program to show exception handling
27 Programming with inner class
28 Programming with wrapper class
29 Write a user-defined exception “low amount” and it should be raised when amount goes
below 10000
30 .Write a Java program to print even and odd number series using two threads
31 Write a Java IO program to read in a file
Write a Java IO program to write in a file
Write a Java IO program to read and write in a file
32 Write a Java IO program to copy the content of one file to another

BIBLIOGRAPHY

Text Books
1. R. Naughton and H. Schildt – Java2 (The Complete Reference) – Fifth Edition – TMH – 2004.
2. Head First Java- A Brain Friendly Guide-Kathy Siera-2nd Edition-OReilly-2009

Reference Books
3. K. Arnold and J. Gosling – The Java Programming Language – 3 rdEdition., Pearson
Edu,2005
4. David Flanagan – Java in a Nutshell: A Desktop Quick Reference for Java Programmers– O‘Reilly
& Associates, Inc. 1999
5. K Somasundaram-Introduction to Java Programming-Jaico Publishing House-2014

Webliography
1. https://www.javatpoint.com/java-tutorial
2. https://www.tutorialspoint.com/java/index.htm
SWAYAM/NPTEL/MOOCs Certification (One from Each Platform, Max 3 Platforms)
3. https://www.coursera.org/specializations/object-oriented-programming
4. https://onlinecourses.nptel.ac.in/noc20_cs58/preview

CAREER OPPORTUNITIES IN JAVA


After competing this course, students can pursue their career in the following areas:
 work as a web developer
 Junior Java Developer
 Mobile Developer
 Front End Developer
 IT Manager COURSEPACK |
 Software Architect
 Full Stack Developer

PROBLEM-BASED LEARNING

Exercises in Problem-based Learning (Practice Problems)


S No Problem
1 Write a Java Program to perform the arithmetic operations using switch case
2 Write a program to check the input character for uppercase, lowercase, no. of
digits and other characters.
3 Write a java program to find the greatest among three numbers.
4 Write a java program that display the roots of a quadratic equation ax2+bx=0.
Calculate the discriminate D and basing on value of D, describe the nature of
Root
5 Write a java program to implement binary search mechanism in use of
following concepts (Operations, Expressions, Control-flow, Strings)
6 Write a Java program that reads a line of integers and then displays each
integer, and the sum of all the integers( Use String Tokenizer class of java.util)
7 Write a Java Program for sorting a given list of names in ascending orde
8 Write a JAVA program to implement class mechanism. - Create a class,
methods and invoke them inside main method.
9 Write a java program to call a windows run time comments.
10 Write a java program to calculate the area of square, rectangle and circle using
method overloading
11 Write a java program to calculate the area of circle and cylinder using method
overriding.
12 Write a java program to calculate the area of rectangle, triangle and circle
method abstract class.
13 Write a java program that implements the concept of package creation
14 Write a java program that implements Interface concept using basic
mathematical function
15 Write a java program to implements exception handling techniques and its
concepts.
16 Write a Java program that implements a multithreaded program has three
threads. First thread generates a random integer every 1 second and if the value
is even, second thread computes the square of the number and prints. If the
value is odd the third thread will print the value of cube of the number.
17 Write a java program to implement Inter Process (Inter Thread)
Communication between classes and there by using the mutual exclusion
among them to display and produce the output.
18 Write a program to convert the given temperature in Fahrenheit to Celsius
using the following conversion formula C = (F - 32)/1.8 And display the values
in a tabular form.
19 Write a program for transposition of a matrix using array copy command
20 Write an application that computes the value of ex by using the formula: ex = 1
+ x/1! + x2/2! + x3/3! +................(4+4+8)
21 Write a program that will compute the following series:
a) 1/1 + 1/2 + 1/3 + ...... + 1/n b) 1/1 + 1/2 + 1/2+....................+ 1/2n. (8+8) COURSEPACK |
22 Write a program to check whether given string is palindrome or not.

23 Write a program to find whether the given triangle is right angled or not
24 Write a program to check the given number is prime or not.
25 Write a program ,which will read a text and count all occurrences of a
particular word.
26 Write a Java program that uses the length() and capacity() methods of the
String Buffer class. Give the output
27 Explain the charAt() and setCharAt() methods of the StringBuffer class.
28 Write a Super class interface employee has name and id number. Write manager and
labour derived from employee class. Manager class has member data qfunction and
qualification and manager allowance & rank Labour class
has member data Dailywage, Overtime & grade.
29 Create an Interface called Integer stack. Write a program that uses this
interface to implement fixed stack and dynamic stack.
30 Write a program to implement a class Teacher contains two fields Name and
Qualification. Extend the class to Department, it contains Dept. No and Dept. Name. An
Interface named 318 College it contains one field Name of the
College. Using the above classes and Interface get the appropriate information and display
it.
31 What are the different types of inheritance that can be implied on Java. Write a program to
show the multilevel inheritance.
32 Write a program to create a private inner class that implements a public interface. Write a
method that returns a reference to an instance of the private inner class, upcast to the
interface. Show that the inner class is completely
hidden by trying to downcast to it
33 Create an interface with at least one method, in its own package. Create a class in a separate
package. Add a protected inner class that implements the interface. Ina third package,
inherit from your class and, inside a method, return an object of the protected inner class,
up casting to the interface during
the return.
34 Write an interface called shape with necessary methods. Derive classes circle,
rectangle, triangle, cone, sphere and cube with appropriate constructors and methods for area,
volume also setting & displaying
35 Write a Java program that simulates a traffic light. The program lets the user select
one of three lights: red, yellow, or green with radio buttons. On selecting a button,
an appropriate message with “Stop” or “Ready” or “Go” should appear above the
buttons in selected color. Initially, there is no message shown
36 What is constructor in Java? How can you differentiate between default
constructor, copy constructor and parameterized constructor? Site suitable example
to show the differences.
37 Write a Java program that creates a user interface to perform integer divisions. The
user enters two numbers in the text fields, Num1 and Num2. The division of Num1
and Num 2 is displayed in the Result field when the Divide button is clicked. If
Num1 or Num2 were not an integer, the program would throw a Number Format
Exception. If Num2 were Zero, the program would throw an Arithmetic Exception.
Display the exception in a message dialog box
COURSEPACK |
38 What is operator overloading. Perform operator overloading to show basic
calculating operations
39 Write a menu-based application to display grades of students. Students having >=
90 marks with grade ‘O’, students having 80-89(Grade ‘E’), students having 70-
79(Grade ‘A’), students having 60-69(Grade ‘B’), students having 50-59(Grade
‘C’), students having 40-49(Grade ‘D’) and otherwise students less than 40 –
‘Grade F’
40 Describe different types of inner class with example.
41 Install a database (Mysql or Oracle). Create a table which should contain at least
the following fields: name, password, email-id, phone number Write a java program
to connect to that database and extract data from the tables and display them. Insert
the details of the users who registers with the UI, whenever a new user clicks the
submit button in the registration page
42 Write a Java program that implements a multi-thread application that has three
threads.
First thread generates random integer every 1 second and if the value is even,
second
thread computes the square of the number and prints. If the value is odd, the third
thread will print the value of cube of the number
43 Write a Java program to print Fibonacci series
44 Demonstrate the use of this, super, static and final keywords in java
45 Write a program in Java to reverse a string

COURSEPACK |
STUDENT-CENTERED LEARNING (SELF-LEARNING
TOWARDS LIFE-LONG- LEARNING)
Self-Learning (it’s a typical course-based project to be carried out by a whole class in
groups of four students each; they should exhibit higher level KLs). The students, in
a group, are expected conceive an idea based on the content (objectives/outcomes) and
apply the suitable knowledge to demonstrate their learning. They can attend
Oracle courses for this segment.

Online Certification Course Link

https://www.codechef.com/practice/
https://skillsforall.com/course/

COURSE-BASED PROJECT (Psychomotor skills)

S Suggested Projects
No
1 Create a class Box that uses a parametrized constructor to initialize the dimension of
the box. The dimension of the Box are width, height and depth. The class should have a
method that can return the volume of the Box. Create
an object of the Box class and test the functionalities.
2 Create a new class called Calculator with the following methods:
1. A static method called powerInt(int num1,int num2) This
method should return num1 to the power num2.
2. A static method called powerDouble(double num1,int num2). This
method should return num1 to the power num2.
3. Invoke both the methods and test the functionalities. Hint: Use
Math.pow(double,double) to calculate the power.
3 Create a class Author with the following information.
Member variables : name (String), email (String), and gender (char) Parameterized
Constructor: To initialize the variables
Create a class Book with the following information.
Member variables : name (String), author (of the class Author you have just created),
price (double), and qtyInStock (int)
[Assumption: Each book will be written by exactly one Author]
Parameterized Constructor: To initialize the variables
Getters and Setters for all the member variables
In the main method, create a book object and print all details of
the book (including the author details)
4 Create a class called Person with a member variable name. Save it in a file called
Person.java
Create a class called Employee that will inherit the Person class. The other data members
of the Employee class are annual salary (double), the year the employee started to
work, and the national insurance number which is a String. Save this in a file called
Employee.java Your class should have the necessary constructors and getter/setter
methods. Write another class called TestEmployee, containing a main method to fully
test your class definition.
COURSEPACK |
5 Write a program to create a class named shape. It should contain
2 methods, draw() and erase() that prints “Drawing Shape” and “Erasing
Shape” respectively.
For this class, create three sub classes, Circle, Triangle and
Square and each class should override the parent class functions
- draw () and erase ().
The draw() method should print “Drawing Circle”, “Drawing Triangle”
and “Drawing Square” respectively.
The erase() method should print “Erasing Circle”, “Erasing
Triangle” and “Erasing Square” respectively.
Create objects of Circle, Triangle and Square in the following way and
observe the polymorphic nature of the class by calling draw() and erase()
method using each object.
Shape c=new Circle();
Shape t=new Triangle();
Shape s=new Square();
6 Create an abstract class Compartment to represent a rail coach. Provide an
abstract function notice in this class.
public abstract String notice();
Derive FirstClass, Ladies, General, Luggage classes from the compartment
class. Override the notice function in each of them to print notice message
that is suitable to the specific type of compartment.
Create a class TestCompartment.Write main function to do the following:
Declare an array of Compartment of size 10.
Create a compartment of a type as decided by a randomly generated integer in the
range 1 to 4.
Check the polymorphic behavior of the notice method. [i.e
based on the random number genererated, the first
compartment can be Luggage, the second one could be Ladies and so on..]

7 Create a package called test package.


Define a class called foundation inside the test package. Inside the
class, you need to define 4 integer variables: var1 with private
access modifier
var2 with default access modifier var3 with
protected access modifier var4 with public
access modifier
Import this class and packages in another class.
Try to access all 4 variables of the foundation class and see what variables
are accessible and what are not accessible.
8 Create a package called com.automobile. Define an abstract class called
Vehicle.
Vehicle class has the following abstract methods: public String
getModelName()
public String getRegistrationNumber() public
String getOwnerName()
Create twowheeler subpackage under automobile package Hero class
extends automobile.vehicle class with the following methods

COURSEPACK |
public int getSpeed()
– returns the current speed of the vehicle.
public void radio()
– provides facility to control the radio device
Honda class extends com.automobile.vehicle class with the following
methods
public int getSpeed()
– Returns the current speed of the vehicle. public
void cdplayer()
– provides facility to control the cd player device which is
available in the car.
Create a test class to test the methods available in all these
child class.
9 Write an interface called Playable, with a method void
play();
Let this interface be placed in a package called music.
Write a class called Veena which implements Playable interface. Let this
class be placed in a package music.string
Write a class called Saxophone which implements Playable interface.
Let this class be placed in a package music.wind Write another class
Test in a package called live. Then,
a. Create an instance of Veena and call play() method
b. Create an instance of Saxophone and call play() method
c. Place the above instances in a variable of type Playable and then
call play()
10 Write a program that takes as input the size of the array and the elements in
the array. The program then asks the user to enter a particular index and
prints the element at that index. Index starts from zero.
This program may generate Array Index Out Of Bounds Exception or
NumberFormatException . Use exception handling mechanisms to handle this
exception.
Sample Input and Output 1:
Enter the number of elements in the array 2
Enter the elements in the array 50
80
Enter the index of the array element you want to access 1
The array element at index 1 = 80
The array element successfully accessed Sample
Input and Output 2:
Enter the number of elements in the array 2
Enter the elements in the array 50
80

COURSEPACK |
Enter the index of the array element you want to access
9
java.lang.ArrayIndexOutOfBoundsException Sample Input and Output 3:
Enter the number of elements in the array 2
Enter the elements in the array 30
j java.lang.NumberFormatException

[Exception Handling: throws]


11 A student portal provides user to register their profile. During registration the
system needs to validate the user should be located in India. If not the system
should throw an exception. Step 1: Create a user defined exception class named
“InvalidCountryException”.
Step 2: Overload the respective constructors.
Step 3: Create a main class “UserRegistration”, add the following method,
void registerUser(String username,String userCountry) with the below
implementation
• if userCountry is not equal to “India” throw a
InvalidCountryException with the message “User Outside India
cannot be registered”
• if userCountry is equal to “India”, print the message “User
registration done successfully”
Invoke the method registerUser from the main method with the data specified and
see how the program behaves.
Example1) i/p:Mickey,US
o/p:InvalidCountryException should be thrown.
The message should be “User Outside India cannot be registered” Example2)
i/p:Mini,India
o/p:User registration done successfully
12 Write a program to accept gender ("Male" or "Female") and age from command line
arguments and print the percentage of interest based on the given conditions.
If the gender is 'Female' and age is between 1 and 58, the percentage of interest is
8.2%.
If the gender is 'Female' and age is between 59 and 100, the percentage of interest is
9.2%.
If the gender is 'Male' and age is between 1 and 58, the percentage of interest is
8.4%.
If the gender is 'Male' and age is between 59 and 100, the percentage of interest is
10.5%.

COURSEPACK |
13 Write a program to initialize an integer array with values and
check if a given number is present in the array or not.
If the number is not found, it will print -1 else it will print the index value of the
given number in the array.
Example 1) If the Array elements are {1,4,34,56,7} and the search element is 90,
then the output expected is -1.
Example 2)If the Array elements are {1,4,34,56,7} and the search element is 56,
then the output expected is 3.

14 Create a class named ‘Animal’ which includes methods like eat() and sleep().
Create a child class of Animal named ‘Bird’ and override the parent class methods.
Add a new method named fly().
Create an instance of Animal class and invoke the eat and sleep methods using this
object.
Create an instance of Bird class and invoke the eat, sleep and fly methods using this
object.
16 Design a student management system using Java
17 Develop an application for managing employee records, including features like adding
new employees, updating details, and generating reports using inner class
18 Create a console-based application that simulates an online voting system for conducting
polls and elections. Users can vote for candidates, and the system tallies the results.
19 Create a banking system simulation where users can open accounts, make transactions,
and view their account balances. Implement features like interest calculation and
account types (using inner class)
20 Create a student management system using inner class

COURSEPACK |

You might also like