Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

BUS 442 Information Systems Development

C#.NET Major Project 1

Assignment Description

This assignment will focus on NC State PCOM IT students on creating an app prototype to calculate a loan amortization schedule for use by car dealerships, in collaboration with a (hypothetical) automotive industry. Amortization is defined as paying offan amount owed overtime by making regular, incremental payments of principal and interest. To amortize a loan simply means "to pay it off." In this project, you will create a C#.Net app which will allow employees of a car dealership to calculate and display an amortization schedule for various customer car loans. This dealership specializes in extending small loans over short time periods limited to 6 months, 12 months, 18 months, and 24 months. During certain times of the year, the car dealership also offers a rebate to the customer as an incentive. The amount of the rebate is subtracted from the loan amount. There are no additional financing fees charged by this dealership.

In the Figure 1 example below, a carloan of $20,000 (minus a rebate of $500) with an annual percentage (APR) rate of 2.5% is amortized over twelve months when the employee inputs the values and clicks the Calculate Loan button. The amount of the rebate (if applicable) is subtracted from the loan amount before the amortization calculations. Notice that for each month, the list box shows the interest amount due, the principal amount due, the monthly payment amount, and the balance due at the end of the month. After each month’s amounts are listed, a blank line and totals for interest, principal, and payment appear.

The dealership employee can explore various loan amounts, months, APR percentages, and rebates with the customer to determine the “best” loan to accept. When the customer is ready to “accept” the “best” loan for their purchase, the employee clicks the Accept Loan button. This event adds the “accepted loan” amount to the daily loan totals for all customers and adds the interest amount to the interest totals for the day (Figure 2). Thus, the app tracks (invariables stored in RAM) the total loan amounts completed for all customers each day.

At any point, the employee may click the Display All Loans button to display the totalLoans and totalInterest variable values in the Total loans and Total interest labels, respectively.

Figure 1

Figure 2

 

Instructions

As the developer, you should consider this app as a prototype. Since the app will not read from a database or make updates to a database, all results will be stored in RAM and cleared when the app ends. Complete the following steps for this prototype:

App Requirements Analysis:

The requirements analysis part of this software development project has already been completed by the Systems Analyst. In fact, this document is one of the “outputs” from that process. Requirements of this project involve two parts:

.    The primary technical requirements of this project are to assess your ability in coding logic, loops, textboxes, combo boxes, labels, list boxes, radio (option) buttons, and checkboxes in a C#.NET app. Be sure to use good GUI design techniques and good coding techniques. Use the UI/UX checklist to ensure your front-end design is standardized.

.    The primary functional requirements of this project are itemized above on page 1. Thus, read through the requirements of this assignment before you begin. Like any good analyst or software developer, you may have questions or assumptions about this project. Address any questions or assumptions with the lecturer or the TA before beginning that part of the assignment.

App Design

The design part of this software development project will be accomplished by you. The design outputs of this project involve two parts:

.     Design and Build the User Interface (UI)

o Design the interface. Feel free to look at the sample provided in Figure 1. Design your own modern UI based on the example shown in Figure 1 or another similar design.

o Use the Enter key at the form level to perform the same as the Calculate Loan button. Use the Escape key to perform the same as the Exit button.

o Set access keys (Alt+ keys) for each button and code them appropriately.

o The default loan month radio button should be six.

o The Rebate textbox  should be disabled for each customer loan until the user checks the Rebate checkbox. The Rebate textbox should then be enabled.

o Set your listbox font to Courier New to get the number spacing to align.

.    Design the App Logic Design with a TOE Chart

o In this part of the design process, you will design the logic of the application. To do this, you will use a design document called a TOE Chart. TOE is an acronym that stands for Task, Object, and Event.

o An example of a TOE chart is found in your textbook and in the Chapter 2 PPT deck. Each event handler (event) in your code should be represented in your TOE chart with its respective object (form control) and tasks. Create a TOE chart (in MS Word or Excel) for this app. Turn this in along with the app.

Build (Code) the App using the UI and the TOE Chart

In general, code the event handlers for these various features:

.    Be sure to select all of the Loan Amount textbox values when the user tabs up to or clicks that field, as well as the Annual APR combobox, so the user doesn’t have to select the data in them manually. Use the .SelectAll method to accomplish this inside of the textbox’s Enter and Click subprocedures.

.    Automatically clear the listbox display (output) amounts on your form if the user changes any of the inputs. Use the .Textchanged method to accomplish this.

.    Use the .KeyPress event to disallow anything but digits, control characters (e.g., the Backspace key), and the period to be entered into the textboxes.

The Exit Button Click event handler should exit the app with a confirmation.

The Calculate Loan button allows the dealership employee to experiment with various inputs and loan times to arrive at the best option for the customer. This button’s Click event handler should do the following:

.     Declare all needed variables (with their correct type), as appropriate.

.     Use Try/Catch to gracefully catch any unanticipated errors and issue an error message.

.     Use the  .TryParse method to get the input from the  entry in the loan amount text box. Save the loan amount in the variable loan.

.     Use the following line of code to read the APR value from the combo box and store it in the variable rate. This line of code converts the string type text of the combo box to a double type variable.

rate = Convert.ToDouble(APRcomboBox.Text);

.     Check for zero values in each of these variables and issue an error message requiring the user to key legitimate data into each respective input control.

.     Use the  .Checked method and conditional logic to get the input from the radio buttons and update a variable named months. Here is an example of how to do this:

if (sixMonthsRadioButton.Checked)

months = 6;

.     Use the .Checked method with the rebate checkbox and conditional logic to see if the customer gets a rebate with the loan. If so, enable the Rebate text box and parse the value to get the rebate amount. Store this in the variable, rebate. Subtract the rebate amount from the loan amount.

.     Convert the rate variable from a percent to a decimal (divide by 100).

.     Calculate the principal payment amount using the following formula. This amount will later be displayed in column 3 of the list box. (Note: The Math.Pow is abuilt-in .NET method that mathematically raises a

number to a power. Future loan value (or a cash balance that you want to attain after the last payment is made) is assumed to be 0 (first 0 in the equation) and payments are due at the end of the month (last zero in the equation). If payments were due at the beginning of the month, the equation’s last 0 would change to a 1.)

principalPayment = rate / 12 * (loan + 0 * Math.Pow(1 + rate / 12, months)) / ((Math.Pow(1 + rate / 12, months) - 1) * (1 + rate / 12 * 0));

(Note: You are welcome to use a more simple formula, as long as it is accurate. See the end of the document for this amount calculated on sample data.)

.     Calculate the monthly interest amount each month using the following formula. This amount will later

be displayed in column 2 of the listbox.

interest = loan * rate/12;

.     Use the following line of code to format the five columns in your listbox. string formatString = "{0,5}{1,12}{2,12}{3,12}{4,12}";

.     Use a for loop to calculate and display the amortization  schedule for the loan. The loop should, at a minimum:

. Setup the loop with initialization, condition, and incrementing the loop counter. The condition should allow the loop to execute as long as the month counter is less than or equal to the number of months selected in the radio button. This is stored in a variable named monthsCounter and is later displayed as column 1 in the listbox.

. Calculate the full payment, pmt, as: principalPayment + interest. This will later be displayed as column 4 in the list box.

. Subtract the principal payment from the loan (minus rebate, if applicable) to get the new loan balance, loan. This will later be displayed as column 5 in the list box.

. Write a line to the listbox. Column  1 is the month (monthsCounter); column 2 is the interest; column 3 is the principal (principalPayment), column 4 is the total of interest and principal (pmt); column 5 is the loan balance (loan).

. Accumulate the three totals to show on the last line of the listbox.

. Recalculate the interest (based on new loan balance) as: interest = loan * rate / 12

. Recalculate the principalPayment (based on new interest amount) as: principalPayment = pmt - interest

.     After the loop, write a blank line and the column totals in the list box.

The Accept Loan “accepts” the loan, as if the customer decided to buy the vehicle and finance it using the last amortization schedule showing on the form. This button’s Click event handler should do the following:

.     Accumulate the amount of all loans in a variable to later display in the Total loans: label.

.     Accumulate the amount of all interest in a variable to later display in the Total interest: label.

.     Clear the list box.

.     Clear all of the textboxes and combo box.

.     Set the rebate checkbox.checked property to false.

.     Set the Month 6 radio button as checked.

.     Disable the rebate textbox.

.     Set the focus on the loan textbox.

The Display All Loans button Click event handler should do the following:

.     Write the amount of all loans (stored in a variable) to the Total loans: label.

.     Write the amount of all interest (stored in a variable) to the Total interest: label.

** Principal payment method on sample data cited in the figure:

(where):

Rate = .025

Months = 12

loan = 19500 (with rebate deducted)

principlePayment = .025/12*(19,500 + 0 * 1.02528845698329) / (1.02528845698329 -1)*(1.00) principlePayment = .025/12*(19,500) / (.02528845698329)*(1.00)

principlePayment = .025/12*(19,500) / (.02528845698329)

principlePayment = $1606.46 (for month 1)