SlideShare a Scribd company logo
1 of 3
Download to read offline
OVERVIEW
Please help with this application which helps an organization calculate the cost of expenses. This
Visual Basic program implements a budget application from the form below. The program has a
class called BudgetReceipts that keeps track of the balance and provides the ability to add to the
income and subtract to the expenses.
The application is designed with a two listboxes named lstIncome and lstExpenses , two
textboxes named txtAmount and txtIncome , two buttons named btnIncome and btnExpense ,
and a close button named btnClose . After an initial amount is entered by a user, the total dollar
amount is shown in the txtIncome textbox. When the bntIncome button is clicked, the user
enters a description of the income and the amount is added to the total. Please edit the code
below so that the description of the income and the amount is show in a static list to the user in
the lstIncome listbox.
When the btnExpense button is clicked, the user enters a description of the expense and the the
amount is subtracted from the total. Please edit the code below so that the description of the
expense and the amount is show in a static list to the user in the lstIncome listbox.
Please add comments throughout each sub of the code.
CODE
Public Class Form1
Private budget As BudgetReceipts
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim initialBalance As Double
Do
initialBalance = InputBox("Enter starting balance:", "Starting Balance")
Loop While initialBalance <= 0
budget = New BudgetReceipts(initialBalance)
txtIncome.Text = budget.Balance.ToString("C")
End Sub
Private Sub btnIncome_Click(sender As Object, e As EventArgs) Handles btnIncome.Click
If Not IsNumeric(txtAmount.Text) Then
MessageBox.Show("Please enter a valid amount.", "Invalid Amount")
Return
End If
Dim description As String = InputBox("Enter income description:", "Income Description")
If description.Trim() = "" Then
MessageBox.Show("Please enter a description.", "Invalid Description")
Return
End If
Dim amount As Double = CDbl(txtAmount.Text)
budget.AddIncome(description, amount)
txtIncome.Text = budget.Balance.ToString("C")
txtAmount.Text = ""
End Sub
Private Sub btnExpense_Click(sender As Object, e As EventArgs) Handles btnExpense.Click
If Not IsNumeric(txtAmount.Text) Then
MessageBox.Show("Please enter a valid amount.", "Invalid Amount")
Return
End If
Dim description As String = InputBox("Enter expense description:", "Expense Description")
If description.Trim() = "" Then
MessageBox.Show("Please enter a description.", "Invalid Description")
Return
End If
Dim amount As Double = CDbl(txtAmount.Text)
budget.SubtractExpense(description, amount)
txtIncome.Text = budget.Balance.ToString("C")
txtAmount.Text = ""
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
End Class
Public Class BudgetReceipts
Private _balance As Double
Public Sub New(initialBalance As Double)
_balance = initialBalance
End Sub
Public ReadOnly Property Balance() As Double
Get
Return _balance
End Get
End Property
Public Sub AddIncome(description As String, amount As Double)
_balance += amount
MessageBox.Show(String.Format("Income added: {0} - {1:C}", description, amount))
End Sub
Public Sub SubtractExpense(description As String, amount As Double)
If _balance - amount < 0 Then
MessageBox.Show("Expense cannot be subtracted. Balance will go negative.")
Else
_balance -= amount
MessageBox.Show(String.Format("Expense subtracted: {0} - {1:C}", description, amount))
End If
End Sub
End Class
Final design

More Related Content

Similar to OVERVIEW Please help with this application which helps an organization.pdf

Chapter 9 financial statements for a sole proprietorship
Chapter 9 financial statements for a sole proprietorshipChapter 9 financial statements for a sole proprietorship
Chapter 9 financial statements for a sole proprietorshipIva Walton
 
Create a Payroll Summary Report in QuickBooks.pdf
Create a Payroll Summary Report in QuickBooks.pdfCreate a Payroll Summary Report in QuickBooks.pdf
Create a Payroll Summary Report in QuickBooks.pdfDancing Numbers
 
eExpense Training
eExpense TrainingeExpense Training
eExpense TrainingTracy_Lynn
 
Ksbt Activity Prices Of Cost Centers
Ksbt Activity Prices Of Cost CentersKsbt Activity Prices Of Cost Centers
Ksbt Activity Prices Of Cost Centerswhocanbe1
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxruthannemcmullen
 
WinEst As 1. Es2. Tassignment stInfo (Esti.docx
WinEst As 1. Es2. Tassignment stInfo (Esti.docxWinEst As 1. Es2. Tassignment stInfo (Esti.docx
WinEst As 1. Es2. Tassignment stInfo (Esti.docxalanfhall8953
 
Bill redirect multiply
Bill redirect multiplyBill redirect multiply
Bill redirect multiplytopomax
 
The Time Value of Money Future Value and Present Value .docx
The Time Value of Money Future Value and Present Value .docxThe Time Value of Money Future Value and Present Value .docx
The Time Value of Money Future Value and Present Value .docxchristalgrieg
 
Closing The Books
Closing The BooksClosing The Books
Closing The BooksMang Engkus
 
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...Soumya De
 
Sap ps training material
Sap ps training materialSap ps training material
Sap ps training materialSoumya De
 
double-entry-accounting-database-design-2000
double-entry-accounting-database-design-2000double-entry-accounting-database-design-2000
double-entry-accounting-database-design-2000Michael Wigley
 
3 meghdoot user manual1
3 meghdoot user manual13 meghdoot user manual1
3 meghdoot user manual1Tanuj Hans
 
Calculator 2
Calculator 2Calculator 2
Calculator 2livecode
 
Northwell health bidding tutorial (vendors)
Northwell health bidding tutorial (vendors)Northwell health bidding tutorial (vendors)
Northwell health bidding tutorial (vendors)Unifier Support
 
Income Tax (Savings) Declaration using greytHR
Income Tax (Savings) Declaration using greytHRIncome Tax (Savings) Declaration using greytHR
Income Tax (Savings) Declaration using greytHRGreytip Software
 
Personal Budget Exercise – MS ExcelFor a review of the complete .docx
Personal Budget Exercise – MS ExcelFor a review of the complete .docxPersonal Budget Exercise – MS ExcelFor a review of the complete .docx
Personal Budget Exercise – MS ExcelFor a review of the complete .docxherbertwilson5999
 
Cognos TM1 Assignments
Cognos TM1 Assignments Cognos TM1 Assignments
Cognos TM1 Assignments rameshkp054
 

Similar to OVERVIEW Please help with this application which helps an organization.pdf (20)

Chapter 9 financial statements for a sole proprietorship
Chapter 9 financial statements for a sole proprietorshipChapter 9 financial statements for a sole proprietorship
Chapter 9 financial statements for a sole proprietorship
 
Create a Payroll Summary Report in QuickBooks.pdf
Create a Payroll Summary Report in QuickBooks.pdfCreate a Payroll Summary Report in QuickBooks.pdf
Create a Payroll Summary Report in QuickBooks.pdf
 
eExpense Training
eExpense TrainingeExpense Training
eExpense Training
 
Ksbt Activity Prices Of Cost Centers
Ksbt Activity Prices Of Cost CentersKsbt Activity Prices Of Cost Centers
Ksbt Activity Prices Of Cost Centers
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
 
WinEst As 1. Es2. Tassignment stInfo (Esti.docx
WinEst As 1. Es2. Tassignment stInfo (Esti.docxWinEst As 1. Es2. Tassignment stInfo (Esti.docx
WinEst As 1. Es2. Tassignment stInfo (Esti.docx
 
Bill redirect multiply
Bill redirect multiplyBill redirect multiply
Bill redirect multiply
 
The Time Value of Money Future Value and Present Value .docx
The Time Value of Money Future Value and Present Value .docxThe Time Value of Money Future Value and Present Value .docx
The Time Value of Money Future Value and Present Value .docx
 
Ingenieria economica
Ingenieria economicaIngenieria economica
Ingenieria economica
 
Closing The Books
Closing The BooksClosing The Books
Closing The Books
 
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
 
Sap ps training material
Sap ps training materialSap ps training material
Sap ps training material
 
double-entry-accounting-database-design-2000
double-entry-accounting-database-design-2000double-entry-accounting-database-design-2000
double-entry-accounting-database-design-2000
 
F-28_WireTransfers
F-28_WireTransfersF-28_WireTransfers
F-28_WireTransfers
 
3 meghdoot user manual1
3 meghdoot user manual13 meghdoot user manual1
3 meghdoot user manual1
 
Calculator 2
Calculator 2Calculator 2
Calculator 2
 
Northwell health bidding tutorial (vendors)
Northwell health bidding tutorial (vendors)Northwell health bidding tutorial (vendors)
Northwell health bidding tutorial (vendors)
 
Income Tax (Savings) Declaration using greytHR
Income Tax (Savings) Declaration using greytHRIncome Tax (Savings) Declaration using greytHR
Income Tax (Savings) Declaration using greytHR
 
Personal Budget Exercise – MS ExcelFor a review of the complete .docx
Personal Budget Exercise – MS ExcelFor a review of the complete .docxPersonal Budget Exercise – MS ExcelFor a review of the complete .docx
Personal Budget Exercise – MS ExcelFor a review of the complete .docx
 
Cognos TM1 Assignments
Cognos TM1 Assignments Cognos TM1 Assignments
Cognos TM1 Assignments
 

More from Nathan2rSPeakes

Paul Sutton had been working for the student life department of Southe.pdf
Paul Sutton had been working for the student life department of Southe.pdfPaul Sutton had been working for the student life department of Southe.pdf
Paul Sutton had been working for the student life department of Southe.pdfNathan2rSPeakes
 
Pathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdf
Pathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdfPathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdf
Pathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdfNathan2rSPeakes
 
Parties to a Blank - an agreement where each party has some probabilit.pdf
Parties to a Blank - an agreement where each party has some probabilit.pdfParties to a Blank - an agreement where each party has some probabilit.pdf
Parties to a Blank - an agreement where each party has some probabilit.pdfNathan2rSPeakes
 
Patent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdf
Patent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdfPatent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdf
Patent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdfNathan2rSPeakes
 
Paul Sutton had been working for the student life department of Southe (1).pdf
Paul Sutton had been working for the student life department of Southe (1).pdfPaul Sutton had been working for the student life department of Southe (1).pdf
Paul Sutton had been working for the student life department of Southe (1).pdfNathan2rSPeakes
 
Patient is a 65-year old woman presenting with a 2-week cough and shor.pdf
Patient is a 65-year old woman presenting with a 2-week cough and shor.pdfPatient is a 65-year old woman presenting with a 2-week cough and shor.pdf
Patient is a 65-year old woman presenting with a 2-week cough and shor.pdfNathan2rSPeakes
 
Parties to a Blank - an agreement where each party has some p.pdf
Parties to a     Blank      - an agreement where each party has some p.pdfParties to a     Blank      - an agreement where each party has some p.pdf
Parties to a Blank - an agreement where each party has some p.pdfNathan2rSPeakes
 
Part Two Read the chapter case- Developing a Strategic Prospecting Pla.pdf
Part Two Read the chapter case- Developing a Strategic Prospecting Pla.pdfPart Two Read the chapter case- Developing a Strategic Prospecting Pla.pdf
Part Two Read the chapter case- Developing a Strategic Prospecting Pla.pdfNathan2rSPeakes
 
Ooenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdf
Ooenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdfOoenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdf
Ooenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdfNathan2rSPeakes
 
Open a new project in Visual Studio Community and name it in the form.pdf
Open a new project in Visual Studio Community and name it in the form.pdfOpen a new project in Visual Studio Community and name it in the form.pdf
Open a new project in Visual Studio Community and name it in the form.pdfNathan2rSPeakes
 
On October 10- the board of directors of Skysong Corporation declared.pdf
On October 10- the board of directors of Skysong Corporation declared.pdfOn October 10- the board of directors of Skysong Corporation declared.pdf
On October 10- the board of directors of Skysong Corporation declared.pdfNathan2rSPeakes
 
Once a user successfully authenticates against a web application- they.pdf
Once a user successfully authenticates against a web application- they.pdfOnce a user successfully authenticates against a web application- they.pdf
Once a user successfully authenticates against a web application- they.pdfNathan2rSPeakes
 
On October 10- the board of directors of Skysong Corporation declared (1).pdf
On October 10- the board of directors of Skysong Corporation declared (1).pdfOn October 10- the board of directors of Skysong Corporation declared (1).pdf
On October 10- the board of directors of Skysong Corporation declared (1).pdfNathan2rSPeakes
 
On November 32022- Nova Corporation's Board of Directors declared a di.pdf
On November 32022- Nova Corporation's Board of Directors declared a di.pdfOn November 32022- Nova Corporation's Board of Directors declared a di.pdf
On November 32022- Nova Corporation's Board of Directors declared a di.pdfNathan2rSPeakes
 
On May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdf
On May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdfOn May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdf
On May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdfNathan2rSPeakes
 
One of the government social programs that is facing obstacles is Soci.pdf
One of the government social programs that is facing obstacles is Soci.pdfOne of the government social programs that is facing obstacles is Soci.pdf
One of the government social programs that is facing obstacles is Soci.pdfNathan2rSPeakes
 
On June 21 - which of the following locations has the shortest day- Om.pdf
On June 21 - which of the following locations has the shortest day- Om.pdfOn June 21 - which of the following locations has the shortest day- Om.pdf
On June 21 - which of the following locations has the shortest day- Om.pdfNathan2rSPeakes
 
Part 2- Encoding a Message - Select a symmetric cipher other than shif.pdf
Part 2- Encoding a Message - Select a symmetric cipher other than shif.pdfPart 2- Encoding a Message - Select a symmetric cipher other than shif.pdf
Part 2- Encoding a Message - Select a symmetric cipher other than shif.pdfNathan2rSPeakes
 
Part c please (a) Suppose that 4 persons are playing one round of rock.pdf
Part c please (a) Suppose that 4 persons are playing one round of rock.pdfPart c please (a) Suppose that 4 persons are playing one round of rock.pdf
Part c please (a) Suppose that 4 persons are playing one round of rock.pdfNathan2rSPeakes
 
part B Pharoah Corporation's capital structure consists of 50-000 shar.pdf
part B Pharoah Corporation's capital structure consists of 50-000 shar.pdfpart B Pharoah Corporation's capital structure consists of 50-000 shar.pdf
part B Pharoah Corporation's capital structure consists of 50-000 shar.pdfNathan2rSPeakes
 

More from Nathan2rSPeakes (20)

Paul Sutton had been working for the student life department of Southe.pdf
Paul Sutton had been working for the student life department of Southe.pdfPaul Sutton had been working for the student life department of Southe.pdf
Paul Sutton had been working for the student life department of Southe.pdf
 
Pathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdf
Pathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdfPathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdf
Pathogen associated molecular patterns (PAMPs) found on Bacteria virus.pdf
 
Parties to a Blank - an agreement where each party has some probabilit.pdf
Parties to a Blank - an agreement where each party has some probabilit.pdfParties to a Blank - an agreement where each party has some probabilit.pdf
Parties to a Blank - an agreement where each party has some probabilit.pdf
 
Patent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdf
Patent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdfPatent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdf
Patent Dete Aloth mank andes and as innales lifetyle PreadiaberteBased.pdf
 
Paul Sutton had been working for the student life department of Southe (1).pdf
Paul Sutton had been working for the student life department of Southe (1).pdfPaul Sutton had been working for the student life department of Southe (1).pdf
Paul Sutton had been working for the student life department of Southe (1).pdf
 
Patient is a 65-year old woman presenting with a 2-week cough and shor.pdf
Patient is a 65-year old woman presenting with a 2-week cough and shor.pdfPatient is a 65-year old woman presenting with a 2-week cough and shor.pdf
Patient is a 65-year old woman presenting with a 2-week cough and shor.pdf
 
Parties to a Blank - an agreement where each party has some p.pdf
Parties to a     Blank      - an agreement where each party has some p.pdfParties to a     Blank      - an agreement where each party has some p.pdf
Parties to a Blank - an agreement where each party has some p.pdf
 
Part Two Read the chapter case- Developing a Strategic Prospecting Pla.pdf
Part Two Read the chapter case- Developing a Strategic Prospecting Pla.pdfPart Two Read the chapter case- Developing a Strategic Prospecting Pla.pdf
Part Two Read the chapter case- Developing a Strategic Prospecting Pla.pdf
 
Ooenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdf
Ooenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdfOoenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdf
Ooenwin - Unadjusted Trial Balance At January 31 Accounts Titles Cash.pdf
 
Open a new project in Visual Studio Community and name it in the form.pdf
Open a new project in Visual Studio Community and name it in the form.pdfOpen a new project in Visual Studio Community and name it in the form.pdf
Open a new project in Visual Studio Community and name it in the form.pdf
 
On October 10- the board of directors of Skysong Corporation declared.pdf
On October 10- the board of directors of Skysong Corporation declared.pdfOn October 10- the board of directors of Skysong Corporation declared.pdf
On October 10- the board of directors of Skysong Corporation declared.pdf
 
Once a user successfully authenticates against a web application- they.pdf
Once a user successfully authenticates against a web application- they.pdfOnce a user successfully authenticates against a web application- they.pdf
Once a user successfully authenticates against a web application- they.pdf
 
On October 10- the board of directors of Skysong Corporation declared (1).pdf
On October 10- the board of directors of Skysong Corporation declared (1).pdfOn October 10- the board of directors of Skysong Corporation declared (1).pdf
On October 10- the board of directors of Skysong Corporation declared (1).pdf
 
On November 32022- Nova Corporation's Board of Directors declared a di.pdf
On November 32022- Nova Corporation's Board of Directors declared a di.pdfOn November 32022- Nova Corporation's Board of Directors declared a di.pdf
On November 32022- Nova Corporation's Board of Directors declared a di.pdf
 
On May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdf
On May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdfOn May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdf
On May 1- Carla Vista Corporation purchased 3-300 shares of its $10 pa.pdf
 
One of the government social programs that is facing obstacles is Soci.pdf
One of the government social programs that is facing obstacles is Soci.pdfOne of the government social programs that is facing obstacles is Soci.pdf
One of the government social programs that is facing obstacles is Soci.pdf
 
On June 21 - which of the following locations has the shortest day- Om.pdf
On June 21 - which of the following locations has the shortest day- Om.pdfOn June 21 - which of the following locations has the shortest day- Om.pdf
On June 21 - which of the following locations has the shortest day- Om.pdf
 
Part 2- Encoding a Message - Select a symmetric cipher other than shif.pdf
Part 2- Encoding a Message - Select a symmetric cipher other than shif.pdfPart 2- Encoding a Message - Select a symmetric cipher other than shif.pdf
Part 2- Encoding a Message - Select a symmetric cipher other than shif.pdf
 
Part c please (a) Suppose that 4 persons are playing one round of rock.pdf
Part c please (a) Suppose that 4 persons are playing one round of rock.pdfPart c please (a) Suppose that 4 persons are playing one round of rock.pdf
Part c please (a) Suppose that 4 persons are playing one round of rock.pdf
 
part B Pharoah Corporation's capital structure consists of 50-000 shar.pdf
part B Pharoah Corporation's capital structure consists of 50-000 shar.pdfpart B Pharoah Corporation's capital structure consists of 50-000 shar.pdf
part B Pharoah Corporation's capital structure consists of 50-000 shar.pdf
 

Recently uploaded

diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfcupulin
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsPallavi Parmar
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Pharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdfPharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdfBALASUNDARESAN M
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfKartik Tiwari
 

Recently uploaded (20)

diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell Tolls
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Pharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdfPharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdf
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 

OVERVIEW Please help with this application which helps an organization.pdf

  • 1. OVERVIEW Please help with this application which helps an organization calculate the cost of expenses. This Visual Basic program implements a budget application from the form below. The program has a class called BudgetReceipts that keeps track of the balance and provides the ability to add to the income and subtract to the expenses. The application is designed with a two listboxes named lstIncome and lstExpenses , two textboxes named txtAmount and txtIncome , two buttons named btnIncome and btnExpense , and a close button named btnClose . After an initial amount is entered by a user, the total dollar amount is shown in the txtIncome textbox. When the bntIncome button is clicked, the user enters a description of the income and the amount is added to the total. Please edit the code below so that the description of the income and the amount is show in a static list to the user in the lstIncome listbox. When the btnExpense button is clicked, the user enters a description of the expense and the the amount is subtracted from the total. Please edit the code below so that the description of the expense and the amount is show in a static list to the user in the lstIncome listbox. Please add comments throughout each sub of the code. CODE Public Class Form1 Private budget As BudgetReceipts Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim initialBalance As Double Do initialBalance = InputBox("Enter starting balance:", "Starting Balance") Loop While initialBalance <= 0 budget = New BudgetReceipts(initialBalance) txtIncome.Text = budget.Balance.ToString("C") End Sub Private Sub btnIncome_Click(sender As Object, e As EventArgs) Handles btnIncome.Click If Not IsNumeric(txtAmount.Text) Then MessageBox.Show("Please enter a valid amount.", "Invalid Amount") Return End If Dim description As String = InputBox("Enter income description:", "Income Description") If description.Trim() = "" Then MessageBox.Show("Please enter a description.", "Invalid Description") Return End If
  • 2. Dim amount As Double = CDbl(txtAmount.Text) budget.AddIncome(description, amount) txtIncome.Text = budget.Balance.ToString("C") txtAmount.Text = "" End Sub Private Sub btnExpense_Click(sender As Object, e As EventArgs) Handles btnExpense.Click If Not IsNumeric(txtAmount.Text) Then MessageBox.Show("Please enter a valid amount.", "Invalid Amount") Return End If Dim description As String = InputBox("Enter expense description:", "Expense Description") If description.Trim() = "" Then MessageBox.Show("Please enter a description.", "Invalid Description") Return End If Dim amount As Double = CDbl(txtAmount.Text) budget.SubtractExpense(description, amount) txtIncome.Text = budget.Balance.ToString("C") txtAmount.Text = "" End Sub Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click Me.Close() End Sub End Class Public Class BudgetReceipts Private _balance As Double Public Sub New(initialBalance As Double) _balance = initialBalance End Sub Public ReadOnly Property Balance() As Double Get Return _balance End Get End Property Public Sub AddIncome(description As String, amount As Double) _balance += amount MessageBox.Show(String.Format("Income added: {0} - {1:C}", description, amount)) End Sub
  • 3. Public Sub SubtractExpense(description As String, amount As Double) If _balance - amount < 0 Then MessageBox.Show("Expense cannot be subtracted. Balance will go negative.") Else _balance -= amount MessageBox.Show(String.Format("Expense subtracted: {0} - {1:C}", description, amount)) End If End Sub End Class Final design