Ex 1: Create a BankTeller class. Write a Bank Teller Console application (started below), which will calculate the optimum combination of notes to be handed out to customers.

A variable Sterling contains the number of pounds sterling to be handed out. The program then works out how many fifties, how many twenties, how many tens, fives and how many one pound coins should be issued. The program output to the console these values.

public class BankTeller {
public static void main(String args[]) {
int sterling=189; //try different values to check your code
int fifties, twenties, tens, fives, ones;
}
}

The modulus operator '%' gives the remainder after division, e.g.

5%2 = 1
11%3 = 2

Test your program with different values for the sterling variable.

Ex 2: Amend your program to provide notes and coins for a floating point sterling value

e.g. float sterling = 26.11;

output should indicate:

1 twenty, 1 five, 1 pound, 0 fifty pence, 0 twenty pence, 1 ten pence, 0 five pence, 1 penniesD
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.