From the course: Learning C#
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Solution: Bank - C# Tutorial
From the course: Learning C#
Solution: Bank
(upbeat music) - [Instructor] All right. So this was a pretty involved challenge. You had to think about what classes you would need and how you would organize them to support a set of banking operations on two separate types of bank accounts. So let's take a look at my code. So I chose to create three different classes. I've got a base class called BankAccount and this class is responsible for holding the information and methods that are common to both the checking and savings accounts. The constructor takes the first and last name of the account owner as well as the initial balance, which defaults to zero. That information is stored in private fields for first and last name, and there's a public property that allows us to access the balance. This class also contains the property, which gives us the account owner name as a single string which I implemented as an interpolated string here. And then finally, there's…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.