In: Computer Science
You will design and create your own GUI application for the Bank project. This project should be designed and written by Java programming.
The requirements of the program:
1. The program will be best implemented as a multi-file program for each class.
2. The parameters and return types of each function and class member should be decided in advance. You may need to add more member variables and functions to the classes than those listed below. Also, you can throws any user-defined exceptions or any possible exceptions.
3. You will create the following class:
A. Design a generic class to hold the information about a Bank. Bank has customers
B. Design a class to hold the information about a Customer. A Customer has an account number and at least one/ or more banking account(s), and all the information about the customer.
C. Design an abstract class to hold the information about a BankingAccount. Balance, number of deposits this month, number of withdrawals, annual interest rate, monthly service charges, etc…
The class should have the following member functions: Constructor, deposit, withdraw, monthly process, etc…
D. Design a SavingsAccount class, derived from the generic BankingAccount class. If the balance of a savings account falls below $25, it becomes inactive. No more withdrawals may be made until the balance is raised above $25, at which time the account becomes active again.
The savings account class should have the following members functions for withdrawing, deposit, status, etc…
E. Next, design a CheckingAccount class, also derived from the generic BankingAccount class. Implement the base class’s withdraw function, this function will determine if a withdrawal (a check written) will cause the balance to go below $0. If the balance does below $0, a service charge of $15 will be taken from the account. If there isn’t enough in the account to pay the service charge, the balance will become negative and the customer will own the negative amount to the bank. service charge for the check written over 5 will add the monthly fee of $5 plus $0.10 per withdrawal (check written). if the check written is below and equal to 5 checks, it will be no charge.
F. Design and create a GUI BankGUIFrame class that allows the user to enter the customer’s information as well as the amounts of withdrawals and deposits for a saving account and checking account. The program should display statistics for the month, including beginning balance, the total amount of deposits, total amount of withdrawals, service charges, and ending balance. Use GUI components. Event handlings for some GUI components.
G. Write a driver BankGUITest class that demonstrates how each of conditions work.
H. The program also need to prevent any exceptions to occur.
Web applications are by nature distributed applications, meaning that they are programs that run on more than one computer and communicate through a network or server. Specifically, web applications are accessed with a web browser and are popular because of the ease of using the browser as a user client. For the enterprise, the ability to update and maintain web applications without deploying and installing software on potentially thousands of client computers is a key reason for their popularity. Web applications are used for web mail, online retail sales, discussion boards, weblogs, online banking, and more. One web application can be accessed and used by millions of people.
Like desktop applications, web applications are made up of many parts and often contain miniprograms, some of which have user interfaces, and some of which do not require a graphical user interface (GUI) at all. In addition, web applications frequently require an additional markup or scripting language, such as HTML, CSS, or JavaScript programming language. Also, many applications use only the Java programming language, which is ideal because of its versatility.
A web application can be as simple as a page that shows the current date and time or as complex as a set of pages on which you can look up and book the most convenient flight, hotels, and car rentals for your next vacation.
The Java technologies you'll use to create web applications are a part of the Java EE platform, in addition to many of the Java Platform, Standard Edition (Java SE) classes and packages. In order for many of these technologies to work on a server, the server must have a container, or web server, installed that recognizes and runs the classes you create. For development and testing of these technologies, you can use the tools detailed in this article, but when you deploy, make sure that the server has Java server software installed to run Java technology-based web applications. If you don't have access to this information, ask the server administrator.
Java Technologies to Use in Web Applications
There are too many Java technologies to list in one article, so this article will describe only the ones most frequently used. The number of technologies listed here can appear overwhelming. Keep in mind that you will not need to use them all. In fact, a web application often consists of nothing more than one page created with the JavaServer Pages (JSP) technology. Sometimes you will combine three or more such technologies. No matter how many you end up using, it's good to know what is available to you and how you can use each one in a web application.
Java Servlet API
The Java Servlet API lets you define HTTP-specific classes. A servlet class extends the capabilities of servers that host applications that are accessed by way of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers. For instance, you might use a servlet to get the text input from an online form and print it back to the screen in an HTML page and format, or you might use a different servlet to write the data to a file or database instead. A servlet runs on the server side -- without an application GUI or HTML user interface (UI) of its own. Java Servlet extensions make many web applications possible.
Figure 1 shows clients talking to Java Servlet extensions. Clients may range in complexity from simple HTML forms to sophisticated Java technology-based applets.
The javax.servlet and javax.servlet.http packages provide the classes and interfaces to define servlets. HTML servlet classes extend the javax.servlet.http.HttpServlet abstract class, which provides a framework for handling HTTP protocol.
Learn more about Java Servlet extensions and navigating with servlets.
JavaServer Pages Technology
JavaServer Pages (JSP) technology provides a simplified, fast way to create dynamic web content. JSP technology enables rapid development of web-based applications that are server- and platform-independent. JSP technology lets you add snippets of servlet code directly into a text-based document. Typically, a JSP page is a text-based document that contains two types of text:
The packages involved in creating JSP pages are javax.el, javax.servlet.jsp, javax.servlet.jsp.el, andjavax.servlet.jsp.tagext, though you will rarely have to import these directly. A JSP page can be as simple as a bit of HTML with one snippet of JSP code and the .jsp extension of the page name.
For instance, you can create a web site of JSP technology pages that use one snippet of code to include the header.html file, which contains the site navigation. This way, when you change a link to a button in the navigation, you make the change in only one file, and that file loads into all the pages on the site that have this code snippet:
<%@ include file="header.html" %>
That line of code works very much like a server-side include, if you are familiar with those. Because this web page is now a JSP page, you could also go on to add more Java technology code to create dynamic web content, such as polls, forms, ways to enter or retrieve data from a database, and so forth.
Take a look at two helpful documents about creating JSP pages:
JavaServer Pages Standard Tag Library
The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many JSP technology-based applications. Instead of mixing tags from numerous vendors in your applications, you employ a single standard set of tags. This standardization allows you to deploy your applications on any JSP container that supports JSTL and makes it more likely that the implementation of the tags is optimized.
JSTL has iterator and conditional tags for handling flow control, tags for manipulating XML documents, internationalization tags, tags for accessing databases using SQL, and tags for commonly used functions.
The packages you can access for using JSTL are javax.servlet.jsp.jstl.core , javax.servlet.jsp.jstl.fmt ,javax.servlet.jsp.jstl.sql , and javax.servlet.jsp.jstl.tlv .
Learn more about JSTL.
JavaServer Faces Technology
JavaServer Faces technology is a UI framework for building web applications. The main components of JavaServer Faces technology involve a GUI component framework, a flexible model for rendering components in various markup languages and technologies, and a standardRenderKit for generating HTML markup.
This functionality is available through standard Java APIs and XML-based configuration files. In addition, Sun Java Studio Creator IDE leverages JavaServer Faces technology in its drag-and-drop GUI tools, allowing you to use the technology without having to write or understand the underlying code. See also " Getting Started With Sun Java Studio Creator."
Java Message Service API
Messaging is a method of communication between software components or applications. A messaging system is a peer-to-peer facility. In other words, a messaging client can send messages to and receive messages from any other client. Each client connects to a messaging agent that provides facilities for creating, sending, receiving, and reading messages. By combining Java technology with enterprise messaging, the Java Message Service (JMS) API provides a powerful tool for solving enterprise computing problems.
Enterprise messaging provides a reliable, flexible service for the exchange of business data throughout an enterprise. The JMS API adds to this a common API and provider framework that enables the development of portable message-based applications in the Java programming language. An example of how JMS might be used is an application that keeps track of inventory for an auto manufacturer.The inventory component can send a message to the factory component when the inventory level for a product goes below a certain level, so the factory can make more cars. The factory component can send a message to the parts components so that the factory can assemble the parts it needs.The parts components in turn can send messages to their own inventory and order components to update their inventories and to order new parts from suppliers and so forth.