Question: Using murach's c#Use an array to store invoice totals Declare two class variables: ( 1 ) an array that can hold up to five invoice

Using murach's c#Use an array to store invoice totals
Declare two class variables: (1) an array that can hold up to five invoice totals
and (2) an index that you can use to work with that array.
Add code that adds the invoice total to the next element in the array each time
the user clicks the Calculate button.
Add code that displays all the invoice totals in the array in a message box
when the user clicks the Exit button. To do that, use a foreach loop to loop
through the totals and format the message for the message box. Within this
loop, you should include an if statement so you only display totals that are not
equal to zero.
Test the program by entering subtotals for up to five invoices and then
clicking the Exit button. This should display a dialog box like this one:
Test the program by entering more than five invoices. When you do, an
IndexOutOfRangeException should be thrown. Then, modify the try-catch
statement so it handles this exception.
Sort the invoice totals
Add code to sort the invoice totals in the array.
Test the program again to be sure that the message box displays the invoice
totals in the correct sequence.
Modify the program so it uses a list
Without changing any of the current code, repeat steps 2 through 8 but use a
list to hold the totals and add a second foreach loop to format and display the
totals stored in the list in a second message box. In other words, display two
message boxes: one for the array and one for the list.
When you've got this working right, close the solution.
 Using murach's c#Use an array to store invoice totals Declare two

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!