009-002-004
Public Modifier: Bank Account
Medium
Problem Description
Public Modifier: Bank Account
In this problem, you will create a program that directly accesses public fields of a BankAccount class from an external class, and displays the account owner and balance in a specified format to standard output.
Learning Objective
Learn access control with public modifier.
Problem
Create a program that displays account information using public fields and methods of BankAccount class.
Input
Line 1: Account owner (string)
Line 2: Balance (integer)
Output
Owner: [owner]
Balance: [balance]
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up