BIMS209 C# ASSIGNMENT 7 banking Console Application

Feb 3rd, 2012
Studypool Tutor
Liberty University
Course: BIMS
Price: $20 USD

Tutor description

PROGRAMMING ASSIGNMENT 7 INSTRUCTIONS Based on the program you created for Assignment 5, modify your code to perform the following steps. In Assignment 5, you created an Account hierarchy with a base class (Account) and two derived classes (SavingsAccount and CheckingAccount). Three of the mutator methods in this assignment validated user input: setBalance, setInterestRate, and setFeeCharged. In all of these methods, you were instructed to set the respective variables equal to zero if the user passed in a negative amount. In this assignment, you will modify your code such that if the user passes in a negative amount, an exception will be thrown that alerts the user that a negative amount has been entered. The program should catch the exception and display the error message to the user. Once an error (negative amount) has occurred, the program should inform the user that negative numbers are not permitted. It should then redisplay the menu. If an exception has not occurred, and a

Word Count: 674
Showing Page: 1/5
Account.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace CSBIMS209Assignment07{ class Account { private double Balance; private string AccountName; private int AccountNumber; public double getBalance() { return Balance; } public void setBalance(double value) { if (value >= 0.0) Balance = value; else Balance = 0; } public string getAccountName() { return AccountName; } public void setAccountName(string value) { AccountName = value; } public int getAccountNumber() { return AccountNumber; } public void setAccountNumber(int value) { AccountNumber = value; } public Account() { } public Account(String p_name, int p_number, double p_balance) { setAccountName(p_name); setAccountNumber(p_number); setBalance(p_balance); } public virtual void Credit(double p_amount) { Balance += p_amount; } public virtual bool Debit(double p_amount) { if(p_amount<0) throw new NegativeNumberException("Invalid Entry - Negative numbers are not permitted."); else if (p_amount >=0 && p_amount <= Balance) { Balance -= p_amount; return true; } else throw new Exception("Insufficien

Review from student

Studypool Student
" <3 it, thanks for saving me time. "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1820 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors