Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Scenario 1 You have been asked to develop an interactive system for online banki

ID: 3843580 • Letter: S

Question

Scenario 1 You have been asked to develop an interactive system for online banking system. The client side would accept from the user the account number and the amount of money being deposited which will then be passed on to the server. Upon receiving the data from the client, the server wi connect to the database which holds records consisting of customer name, balance and account number, and use the account number provided by the client to search the database for a matching record. Once the matching record is found, the balance will be retrieved from the database and added to the deposited amount provided by the client. The new balance will then be used to calculate the interest. The new balance and the interest will be sent back to the client where they will be displayed on screen for the user. The interest rate used would be 0.02 which is stored on the server. If a matching record is not found, send back an appropriate message such as 0 for both the balance and interest. Develop a clien server application to implement this system with the following tasks:

Explanation / Answer

Hi,

I have coded the client program which will take the input from user ans will do all the validation on the java server.

If validation passes then the balance is recalculated.Interest is calculated and then the new balance is updated in the database.

Follwoing are used:-

javascript

SQL

JAVA

CODE FOR CLIENT SIDE:-

========================================================================================

<center><h1 align="">customer details </h1></center>
       <form action="customerdetails.jsp" >
       <table align="center" cellpadding=20><tr><td>

   <tr><td> <div class="form-group">

<input type="text" name="name" class="form-control" placeholder="Enter Accno" size="40"required />
</div>

   <tr><td> <div class="form-group">

<input type="deposit" name="deposit" class="form-control" placeholder="Enter Deposit" size="40"required />
</div>
<tr><td><button type="submit" class="btn btn-default">DEPOSIT</button>
<td></td>


</tr>

</table>                      
</div>
       </form>
       <br>

=======================================================================================

CODE FOR SERVER,VALIDATION AND DATABASE FETCH UPDATE:-

=====================================================================================

<%@page import="databaseconnection.*,java.sql.*"%>
<%!
Connection con;
Statement stmt;
ResultSet rs;
%>
<%
int accno = request.getParameter("accno");
int deposit = request.getParameter("deposit");
int balance;
con = databasecon.getconnection();
stmt = con.createStatement();
rs = stmt.executeQuery("select accname,balance from custdata where accno="+accno+"");

if(rs.next())
{
int interest =0.02;
int interestRate;
String str = rs.getString("balance");
int accbal = Integer.parseInt(str);
balance=accbal+deposit;
interestRate=(balance*0.02/100);
out.println("<script>alert('Hello Customer!>.')</script>");
%>
   <tr bgcolor="#6699ff"><td><font size="3" color="white"><center><%=rs.getString(1)%></center><td></a>
   <%
   out.println("<script>alert('Your updated balance is:-')</script>");
     
%>
   <tr bgcolor="#6699ff"><td><font size="3" color="white"><center><%=balance%></center><td></a>
   <%
   out.println("<script>alert('Calculated interest is:-')</script>");
%>
   <tr bgcolor="#6699ff"><td><font size="3" color="white"><center><%=interestRate%></center><td></a>
   <%
  
  
PreparedStatement p=con.prepareStatement("update custdata set balance ="+balance+" where accno="+accno+" ");
int dd=   p.executeUpdate();
}
else
{
out.println("<script>alert('Sorry You dont Bank with us!-')</script>");
}
%>

===================================================================================

Please let me know in case any clarification is required.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote