benefits of using implementation independent data structures related to stacks
1 Context Singleton pattern is one of the simplest design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object. This pattern involves a single class which is responsible to create an object while making sure that only single object gets created. This class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class.
2 Problem description In this study, you need to develop a program that will calculate coins using the ’Singleton Pattern’. Adding coins will be increased by 10 points, but decreasing by one point will be reduced. You should try 3 approaches of Singleton while developing this program. ∗ Eager initialization ∗ Lazy Initialization ∗ Thread Safe Singleton
You are required to write a program that implements the computerized maintenance of your
monthly expenditure record keeping. You will have to build two classes ExpenseItem,
ExpenseLedger
The class ExpenseLedger will record all the expenses you make. You record an expense by giving
it a serial number, a description (that tells what it is about) and the money you spent on this item. So
you need to create a class ExpenseItem with serial, description and amount. Provide constructors,
getters and setters. Also provide toString for this class. Now in the ExpenseLedger class you need to
build a collection that will hold the instance of ExpenseItem. Provide the following methods in the
ExpenseLedger
1. int removeSmallExpenses(double amt):This method will find expense items that are smaller or equal to amount amt & then remove these items from list. Note that multiple items can be smaller than this value & thus each of these should be removed & return number of items removed.
write a program that implements computerized maintenance of your
monthly expenditure record keeping. You will have to build two classes ExpenseItem, ExpenseLedger
The class ExpenseLedger will record all expenses you make. You record an expense by giving it a serial number, a description (that tells what it is about) & money you spent on this item. So you need to create a class ExpenseItem with serial, description and amount. Provide constructors,
getters & setters & toString for this class. Now in ExpenseLedger class you need to build a collection that will hold instance of ExpenseItem. Provide following methods in
ExpenseLedger
1. void addExpense(description, amount): You should be able to figure out the serial of expense yourself. This method will create an expense item and add it to ledger
write a program that implements computerized maintenance of your
monthly expenditure record keeping. You have to build two classes ExpenseItem, ExpenseLedger
The class ExpenseLedger will record all expenses you make. You record an expense by giving it a serial number, a description (that tells what it is about) and money you spent on this item. So you need to create a class ExpenseItem with serial, description and amount. Provide constructors,
getters & setters & toString for this class. Now in ExpenseLedger class you need to build a collection that will hold instance of ExpenseItem. Provide following methods in ExpenseLedger
1. int removeSmallExpenses(double amt):This method will find expense items that are smaller or equal to amount amt and then remove these items from list. Note that multiple items can be smaller than this value and thus each of these should be removed. Also this method should return number of items removed.
2. Override toString method to print ledger in well formatted form
Inserting a record
ABC International School wants to computerize students details. The school maintains a database of students in Oracle. The student table contains information related to students and is shown in the following student table structure.
Column Name Type Constraint
Rollno Number (4) Primary Key
StudentName Varchar (20) Not Null
Standard Varchar (2) Not Null
Date_Of_Birth Date
Fees Number (9,2)
When a new student joins the school, the student record is inserted in the student table. The valid student details are as follows:
• Rollno: Valid value is a 4-digit number
• StudentName: Valid value can contain maximum 20 letters in uppercase
• Standard : Valid values are Roman Letters representing I to X(I, II, III, IV….IX, X)
Write a Java program to insert some records to the table.
Write a program in Java that enters student details (Roll No, Name etc) and retrieves information.
Use oracle as a database and write the application in JDBC.
Write a Java program with the help of JDBC to perform Add student operation in Student table.
A, e, i, o, u?
by CodeChum Admin
Instructions:
Input
Multiple lines containing a character on each.
c
f
a
Output
Multiple lines containing a character on each.
c
f
a