subject

This lab is designed to give you practice working with programmer defined methods. you will write a method named validate to a local banker. your method will need to utilize two input parameters and the method's return value (for its output).

getting started
to start this exercise, you should
open eclipse and start a new java project named lab09
add a class (named lab09) to this project.
cut the program from this document and paste (replacing everything) in the eclipse editor window.
lab09.java

/*
comment block here
*/

import java. util. scanner;
public class lab09
{
public static void main(string[] args)
{
scanner stdin = new scanner(system. in);
double curbal = 45.32;
double amount;
system. out. print(" enter a amount to update account by $");
amount = stdin. nextdouble();
system. out. print("\n");
system. out. print("customer\'s balance (before transaction) = $");
system. out. println(curbal + "\n");
system. out. print("requested update amount = $");
system. out. println(amount + "\n");
double actamount;
actamount = validate(curbal, amount);
curbal += actamount;
system. out. print("actual update amount = $");
system. out. println(actamount + "\n");
system. out. print("customer\'s balance (after transaction) = $");
system. out. println(curbal + "\n");
system. out. println(" you and good-bye! \n");
}

public static double validate(double bal, double amount)
{
// write your code here
return 0.0; // actual return value here (not 0.0)
}
}
problem description

1-read through the existing code to understand what it does and what is left for you to do.
2-compile and run the program as-is, to verify that you understand what it does and what is left for you to do.
3-write the missing code in the java program program provided so that it satisfies the following specification:
-for this part of the assignment you will be using the lab09.java file that you copied using the command above.
-a local banker has asked you to write a method named validate which takes :
-a customer's current balance
-the amount of money to update the account by :
a positive dollar amount is a deposit
a negative dollar amount is a withdraw

as input parameters, and then returns

-for deposits: the deposit amount is simpily returned by the function.
-for withdraws: the balance must not become negative. if a withdraw is requested for more than the current balance then the amount (which would zero the balance if withdrawn) is returned by the method. otherwise the withdraw amount is simpily returned by the method.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
When building customer relationships through email what should you not do? question 2 options: utilize proper grammar, spelling, and punctuation type in all capital letters use hyperlinks rather than attachments respond to all emails within 24 hours
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
question
Computers and Technology, 24.06.2019 02:50
Be sure to answer all parts. synthesize the following compound from benzene. a. b. c. d. e. f. reaction [1] conditions: a b c d e f reaction [1] product: draw structure reaction [2] conditions: a b c d e f reaction [2] product: draw structure reaction [3] conditions: a b c d e f reaction [3] product:
Answers: 3
You know the right answer?
This lab is designed to give you practice working with programmer defined methods. you will write a...
Questions
question
Mathematics, 04.12.2019 01:31
question
Mathematics, 04.12.2019 01:31