Question

In: Computer Science

1. Servlet program to find the information about an account holder at a bank. ( Bank...

1. Servlet program to find the information about an account holder at a bank.
( Bank name= your name )
(I'm using netbeans with glassfish, lecturer mentioned not to use jsp, mostly use CSS, Javascript, html, xml)
• Case:
a) Have username and password authentication
b) Display his Account balance to be RM10000,
c) Show different functionalities of a bank account (Deposit, Withdrawal, Print)
d) For every transaction make sure make use of his account balance.
e) Perform the functionalities(Deposit, Withdraw and print) until the user selects
to stop.

Solutions

Expert Solution

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<style>
body{
   background: lightgreen;
}

.zeros {
font-size: 20px;
width: 30%;
border: 1px solid;
font-weight: bold;
margin: 0 auto;
height: 220px;
}
table tr td{
border: 1px solid;
text-align: center;
}
td input[type="button"] {
width: 100%;
height: 33px;
border: none;
font-size: 19px;
font-weight: bold;
background: #D2F4FE;
cursor: pointer;
}
.rupees{
width: 25%;
margin: 0 auto;
}
h3.total {
font-size: 20px;
border: 1px solid;
display: inline-block;
width: 31.33%;
padding: 4px;
height: 46px;
}
.btn {
width: 20%;
text-align: center;
display: inline-block;
margin-left: 276px;
}
.btn input[type="button"] {
width: 100%;
height: 40px;
font-size: 19px;
font-weight: bold;
cursor: pointer;
}
</style>
<body>

<div class="wrapper">
<div class="rupees">
<table cellspacing=10px style="border: 1px solid" >
<tr>
<th>Amount</th>
<th>Quantity</th>
<th>Amount</th>
<th>Quantity</th>
</tr>
<tr>
<td>5000</td>
<td id="fiveThousands">-</td>
<td>20</td>
<td id="twenty">-</td>
</tr>
<tr>
<td>1000</td>
<td id="thousand">-</td>
<td>10</td>
<td id="ten">-</td>
</tr>
<tr>
<td>500</td>
<td id="fiveHundred">-</td>
<td>5</td>
<td id="five">-</td>
</tr>
<tr>
<td>100</td>
<td id="hundred">-</td>
<td>2</td>
<td id="two">-</td>
</tr>
<tr>
<td>50</td>
<td id="fifty">-</td>
<td>1</td>
<td id="one">-</td>
</tr>

<tr>
<td colspan="4"><input type="button" value="Enter Currency" onclick="amount()"></td>
</tr>

</table>
</div>
<h3 class="total">Total Amount:
<span id="totalAmount"></span>   
</h3>
<h3 class="total">Amount Deducted:
<span id="AmountEnter"></span>   
</h3>
<h3 class="total">Balance:
<span id="Balance"></span>   
</h3>
<p class="btn btn-1"><input type="button" value="Enter Amount" onclick="enterAmount()"></p>
<p class="btn btn-2"><input type="button" value="Generate Slip" onclick="generateSlip()"></p>
<p id="zero" class="zeros"></p>

</div>
</div>
  
</body>
<script>
var f5000 = 0;
var f1000 = 0;
var f500 = 0;
var f100 = 0;
var f50 = 0;
var f20 = 0;
var f10 = 0;
var f5 = 0;
var f2 = 0;
var f1 = 0;
var total = 0;
var amountEntered = 0;

  
function amount(){
f5000 = parseInt(prompt("enter 5000 notes"))
document.getElementById("fiveThousands").innerHTML=f5000

f1000 = parseInt(prompt("enter 1000 notes"))
document.getElementById("thousand").innerHTML=f1000

f500 = parseInt(prompt("enter 500 notes"))
document.getElementById("fiveHundred").innerHTML=f500

f100 = parseInt(prompt("enter 100 notes"))
document.getElementById("hundred").innerHTML=f100

f50 = parseInt(prompt("enter 50 notes"))
document.getElementById("fifty").innerHTML=f50

f20 = parseInt(prompt("enter 20 notes"))
document.getElementById("twenty").innerHTML=f20

f10 = parseInt(prompt("enter 10 notes"))
document.getElementById("ten").innerHTML=f10

f5 = parseInt(prompt("enter 5 coins"))
document.getElementById("five").innerHTML=f5

f2 = parseInt(prompt("enter 2 coins"))
document.getElementById("two").innerHTML=f2

f1 = parseInt(prompt("enter 1 coins"))
document.getElementById("one").innerHTML=f1

total = (f5000*5000)+(f1000*1000)+(f500*500)+(f100*100)+(f50*50)+(f20*20)+(f10*10)+(f5*5)+(f2*2)+(f1)
document.getElementById("totalAmount").innerHTML= total;
document.getElementById("zero").innerHTML= ""
}

function enterAmount(){
amountEntered = parseInt(prompt("Enter amount You pay: "))
hamza = amountEntered
if(amountEntered <= total){
total = total - amountEntered;
document.getElementById("AmountEnter").innerHTML = amountEntered;
document.getElementById("totalAmount").innerHTML= total;
document.getElementById("Balance").innerHTML= total;

if (amountEntered>=5000){
if (amountEntered >=(f5000*5000) && f5000>0){
amountEntered = amountEntered - (f5000*5000)
r1 = f5000
f5000= 0
}else{
if(f5000>0){
r1 = Math.floor(amountEntered/5000)
f5000 = f5000 - Math.floor(amountEntered/5000)
amountEntered = amountEntered - (Math.floor(amountEntered/5000)*5000)
  
}
}
document.getElementById("fiveThousands").innerHTML=f5000;
}

if (amountEntered>=1000){
if (amountEntered >=(f1000*1000) && f1000>0){
amountEntered = amountEntered - (f1000*1000)
r2 = f1000
f1000= 0
}else{
if(f1000>0){
r2 = Math.floor(amountEntered/1000)
f1000 = f1000 - Math.floor(amountEntered/1000)
amountEntered = amountEntered - (Math.floor(amountEntered/1000)*1000)
  
}
}
document.getElementById("thousand").innerHTML=f1000;
}

if (amountEntered>=500){
if (amountEntered >=(f500*500) && f500>0){
amountEntered = amountEntered - (f500*500)
r3 = f500
f500= 0
}else{
if(f500>0){
r3 = Math.floor(amountEntered/500)
f500 = f500 - Math.floor(amountEntered/500)
amountEntered = amountEntered - (Math.floor(amountEntered/500)*500)
  
}
}
document.getElementById("fiveHundred").innerHTML=f500;
}
if (amountEntered>=100){
if (amountEntered >=(f100*100) && f100>0){
amountEntered = amountEntered - (f100*100)
r4 = f100
f100= 0
}else{
if(f100>0){
r4 = Math.floor(amountEntered/100)
f100 = f100 - Math.floor(amountEntered/100)
amountEntered = amountEntered - (Math.floor(amountEntered/100)*100)
  
}
}
document.getElementById("hundred").innerHTML=f100;
}
if (amountEntered>=50){
if (amountEntered >=(f50*50) && f50>0){
amountEntered = amountEntered - (f50*50)
r5 = f50
f50= 0
}else{
if(f50>0){
r5 = Math.floor(amountEntered/50)
f50 = f50 - Math.floor(amountEntered/50)
amountEntered = amountEntered - (Math.floor(amountEntered/50)*50)
  
}
}
document.getElementById("fifty").innerHTML=f50;
}
if (amountEntered>=20){
if (amountEntered >=(f20*20) && f20>0){
amountEntered = amountEntered - (f20*20)
r6 = f20
f20= 0
}else{
if(f20>0){
r6 = Math.floor(amountEntered/20)
f20 = f20 - Math.floor(amountEntered/20)
amountEntered = amountEntered - (Math.floor(amountEntered/20)*20)
  
}
}
document.getElementById("twenty").innerHTML=f20;
}
if (amountEntered>=10){
if (amountEntered >=(f10*10) && f10>0){
amountEntered = amountEntered - (f10*10)
r7 = f10
f10= 0
}else{
if(f10>0){
r7 = Math.floor(amountEntered/10)
f10 = f10 - Math.floor(amountEntered/10)
amountEntered = amountEntered - (Math.floor(amountEntered/10)*10)
  
}
}
document.getElementById("ten").innerHTML=f10;
}
if (amountEntered>=5){
if (amountEntered >=(f5*5) && f5>0){
amountEntered = amountEntered - (f5*5)
r8 = f5
f5= 0
}else{
if(f5>0){
r8 = Math.floor(amountEntered/5)
f5 = f5 - Math.floor(amountEntered/5)
amountEntered = amountEntered - (Math.floor(amountEntered/5)*5)
  
}
}
document.getElementById("five").innerHTML=f5;
}
if (amountEntered>=2){
if (amountEntered >=(f2*2) && f2>0){
amountEntered = amountEntered - (f2*2)
r9 = f2
f2= 0
}else{
if(f2>0){
r9 = Math.floor(amountEntered/2)
f2 = f2 - Math.floor(amountEntered/2)
amountEntered = amountEntered - (Math.floor(amountEntered/2)*2)
  
}
}
document.getElementById("two").innerHTML=f2;
}
if (amountEntered>=1){
if (amountEntered >=(f1*1) && f1>0){
amountEntered = amountEntered - (f1*1)
r10 = f1
f1= 0
}else{
if(f1>0){
r10 = Math.floor(amountEntered/1)
f1 = f1 - Math.floor(amountEntered/1)
amountEntered = amountEntered - (Math.floor(amountEntered/1)*1)
  
}
}
document.getElementById("one").innerHTML=f1;
}
document.getElementById("zero").innerHTML= ""
}else{
document.getElementById("AmountEnter").innerHTML= "We have insufficient Balance"
document.getElementById("zero").innerHTML= ""
document.getElementsByClassName("btn-2")[0].innerHTML= ""
}
}

  

</script>
</html>


Related Solutions

• 1. Write a java program using methods to find the information about a account holder...
• 1. Write a java program using methods to find the information about a account holder at bank. d) Perform the functionalities(Deposit, Withdraw and print) until the user selects to stop.
• 1. Write a java program using methods to find the information about a account holder...
• 1. Write a java program using methods to find the information about a account holder at bank. b) Show different functionalities of a bank account (Deposit, Withdrawal, Print)
• 1. Write a java program using methods to find the information about a account holder...
• 1. Write a java program using methods to find the information about a account holder at bank. c) For every transaction make sure make use of his account balance.
JAVA PROGRAM: Creates a Bank Account class with one checking account and methods to withdraw and...
JAVA PROGRAM: Creates a Bank Account class with one checking account and methods to withdraw and deposit. Test the methods in the main function.
You work for a bank that has a program with a dependency of the account class....
You work for a bank that has a program with a dependency of the account class. Unfortunately the hard drive that contained the source code for the account class went bad and no backup can be found. Obviously, this means you bank needs to address this issue. However, your task is to recreate the account class. The good news is that your company was able to locate a tester of the account class and one helper function to output the...
Find information on the central bank in the US and find the comparable institution for the...
Find information on the central bank in the US and find the comparable institution for the country you have chosen. What role does the central bank play in each country; how much power does it have, independent of the government? In other words, who makes the monetary policy decisions in each country? Provide an explanation of the material that you present. In particular, discuss how monetary policy is undertaken in the country and the central bank's role in this. What...
(In C++) Bank Account Program Create an Account Class Create a Menu Class Create a main()...
(In C++) Bank Account Program Create an Account Class Create a Menu Class Create a main() function to coordinate the execution of the program. We will need methods: Method for Depositing values into the account. What type of method will it be? Method for Withdrawing values from the account. What type of method will it be? Method to output the balance of the account. What type of method will it be? Method that will output all deposits made to the...
Understanding bank account controls Answer the following questions about the controls in bank accounts:
Question Understanding bank account controls Answer the following questions about the controls in bank accounts:Requirements1. Which bank control protects against forgery?2. Which bank control reports the activity in the customer’s account each period?3. Which bank control confirms the amount of money put into the bank account? 
Silver Inc. maintains a checking account with ABC Bank, The following ledger account provides information for...
Silver Inc. maintains a checking account with ABC Bank, The following ledger account provides information for the records related to the beginning balance, deposits, and payments with check. The following cash ledger account is obtained from the company's ledger book for the month ending January 31. Cash Account Deposits: Checks written: Jan.1 Balance $4,851.23 Jan.13 Ck.no. 213 $423 Jan.19 Deposit $5,000 Jan.24 Ck.no. 214 $125 Jan.27   Deposit $2,400 Jan.26 Ck.no.215 $200 Jan.30   Deposit $1,000 Jan.28 Ck.no.216 $163 Jan.31    Deposit $800...
Write a program to create a bank account and to process transactions. Call this class bankAccount...
Write a program to create a bank account and to process transactions. Call this class bankAccount A bank account can only be given an initial balance when it is instantiated. By default, a new bank account should have a balance of 0. A bank account should have a public get method, but no public set method. A bank account should have a process method with a double parameter to perform deposits and withdrawals. A negative parameter represents a withdrawal. It...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT