Java
Java
defined strings.
5. Write an application that finds the length of a given string.
6. Write an application that uses String method charAt to reverse the string.
7. Write an application that finds the substring from any given string using
substring method and startsWith & endsWith methods.
8. Write an application that changes any given string with uppercase letters,
displays it , changes it back to lowercase letters and displays it.
Program List 4 :
Submission : end of week 4
1. Create a class called Employee that includes three pieces of information as
instance variables a first name (type String), a last name (type String) and
a monthly salary (double)
2. Create a constructor in above class to initialize the three instance variables.
Provide a get method for each instance variable.
3. Write a test application named EmployeeTest that demonstrates class
Employees capabilities. Create two employee objects and display each
objects yearly salary.
4. Give each employee a 10% raise and display each Employees yearly salary
again.
5. Create a class Account with an instance variable balance (double). It should
contain a constructor that initializes the balance, ensure that the initial
balance is greater than 0.0.
6. Create two methods namely credit and getBalance. The first one adds the
amount (passed as parameter) to balance and does not return any data. The
second method allows clients (i.e. the other classes that use this class) to
obtain the value of a particular Account objects balance.
scholar resp. .
Program List 6 :
Submission : end of week 8
1. Create an abstract class Shape which calculate the area and volume of 2-d
and 3-d shapes with methods getArea and getVolume. Reuse this class to
calculate the area and volume of square ,circle ,cube and sphere.
2. Create an abstract class Employee with methods getAmount() which
displays the amount paid to employee. Reuse this class to calculate the
amount to be paid to WeeklyEmployeed and HourlyEmployee according to
no. of hours and total hours for HourlyEmployee and no. of weeks and total
weeks for WeeklyEmployee.
3. Create an Interface payable with method getAmount ().Calculate the amount
to be paid to Invoice and Employee by implementing Interface.
4. Create an Interface Vehicle with method
getColor(),getNumber(),getConsumption(). Calculate the fuel consumed,
name and color for TwoWheeler and FourWheeler by implementing
interface Vehicle.
5. Create an Interface Fare with method getAmount() to get the amount paid
for fare of travelling. Calculate the fare paid by bus and train implementing
interface Fare.
6. Create an Interface StudentFee with method getAmount(),
getFirstName(),getLastName(), getAddress(), getContact(). Calculate the
amount paid by the Hostler and NonHostler student by implementing
interface StudentFee.
7. Write a Program to create your own package. Package should have more
than two classes. Write a class that uses the package.
TextField.
11. Write an application to create a GUI with two buttons such that clicking on
the first displays the message Welcome to SCS on the window and
clicking on the second changes the color of the message(hint : toggle the
color)
12. Create a GUI with title STUDENT which has labels roll no., name, class,
address with textboxes for taking input from the user(without any
functionality).
13. Create a GUI application for fees receipt which contains checkboxes for
selecting the course, radio buttons for selecting gender and labels and
corresponding textboxes for name, class, date and amount paid.
14. Create a GUI application to display a calculator using grid Layout (You do
not have to provide functionality).
Program List 11 :
Submission : end of week 14
1. WAP for string tokenizer.
2. Create a program that will print every other argument given on the
command line. (Use of string tokenizer), consider how your program will
deal with no argument.
3. WAP that generate a random number (1 10000). Let the user guess the
correct number. User will enter the digit. Program should let the user that
input is right or wrong. No of turns that user can make a choice for input is
twice the number of digits in the system generated numbers.
4. Convert the input date in words. Input format is dd mm yy.
5. Find the frequency of each number in the array.