Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:50, Crull5999
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, trippie4life
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
Answers: 2
image
Computers and Technology, 23.06.2019 21:40, jeovontamarley
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
image
Computers and Technology, 24.06.2019 05:30, lolololol21
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
Do you know the correct answer?
This lab is designed to give you practice working with programmer defined methods. you will write a...

Questions in other subjects: