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:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
question
Computers and Technology, 24.06.2019 13:50
What does code do? a creates a text box that says "solid black" b creates a black border of any width c creates a black border 1 pixel wide
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What is the function of compilers and interpreters? how does a compiler differ from an interpreter?
Answers: 2
You know the right answer?
This lab is designed to give you practice working with programmer defined methods. you will write a...
Questions
Questions on the website: 13722363