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 00:00
11. is the ability to understand how another person is feeling. a. authority b. sympathy c. empathy d. taking a stand
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
These statements describe lists in presentation programs: a. bullets can be turned off and on. b. bullets cannot be turned off. c. bullet styles, colors, and sizes can be changed. d. lists don't have to use bullets or numbers. e. numbering styles, colors, and sizes can be changed. f. numbers can be turned off and on. g. numbers cannot be turned off. select all that apply
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior
Answers: 1
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, 28.06.2019 02:00
question
History, 28.06.2019 02:00
question
Mathematics, 28.06.2019 02:00
Questions on the website: 13722363