Assignment: Write a java class()es with methods to manage a loyalty points/rewar
ID: 3582325 • Letter: A
Question
Assignment: Write a java class()es with methods to manage a loyalty points/reward program for a small bakery. All classes should have at least a null constructor and copy constructor. Other constructors would be up to your discretion. Include all necessary accessors and modifiers.
To test your classes, create a Container class with simply a main() method. The Container class will have attributes that are class objects of each of the classes you create. The main() method will create the class objects, perform some normal business for that store, and produce appropriate output
An example can be:
-Spending a certain amount of money will earn the customer a certain amount of points that the customer can use.
-Loyalty Card Check - this method will determine if a customer is a member of the Loyalty Program
-Loyalty Card Add - this method will add to the customer points if the customer is a member of the loyalty program
-Loyalty Discount - this method will apply the discount to the
And/Or
-A punch card system where a customer buys 9 coffees and gets one free
Explanation / Answer
Solution: public interface PlatformBakeryTransaction{
TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException;
void commit(TransactionStatus status) throws TransactionException;
void rollback(TransactionStatus status) throws TransactionException;
}
public interface TransactionStatus
{
boolean isNewTransaction();
void setRollbackOnly();
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
boolean isRollbackOnly();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.