联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2020-10-03 10:53

S308 Assignment 2 – Student Loan Calculator

Each year, IUK Corp. provide students loan for those in need. However, the maximum loan amount

each student can get is different. In this assignment, your job is to create a WPF application that allows

students to enter the following information: birthday, email, tuition fees, types of students (u=

undergraduate, g = graduate), and residential status (in-state, out-of-state, or foreign).

The program should show two results after a user clicks the apply button: Maximum Loan Amount, and

Yearly Interest Rate. All output should be rounded to 2 decimal places and formatted appropriately as

currency for Loan Amount and percentage for Interest Rate. A clear button that clears all values

should also be included (both outputs and inputs).

More Requirements:

1. You must check that the tuition entered by the user is a double number. If the user enters something

other than a double number, your program should communicate that to the user using a MessageBox.

Also, if the user enters a number that is less than 0, the application should request the user to enter a

non-negative number using a MessageBox.

2. For Birthday Textbox, assume a user would only use the following format: “xx/xx/xxxx” (e.g.,

06/15/1998). (This means you do not have to validate Birthday.)

3. For student types, you should check whether users enter "U" or "G". If not, you should use

MessageBox to ask the users to reenter the corrected information. In addition, the program is case

insensitive and white space insensitive, which means "U", " U ", "u" are the same for the program.

4. Residential status should be a Combobox, and have only three values: in-state, out-of-state, or

foreign. A user must choose one of the three values. If a user does not choose a value, the program

should communicate that to the user using a MessageBox.

5. Email should contain @. If an email doesn’t contain any, the program should communicate that to the

user using a MessageBox.

In all cases where the input isn’t valid, you should prevent the program from executing any more code

until the user corrects the problem and submits the form again.

Rules to calculate loan:

1. For an undergraduate student, the default loan amount is $30,000.

2. For a graduate student, the default loan amount is $50,000.

3. The following table provides a rule for adjustment.

Resident Status Rule

in-state Get Extra 20% (i.e., multiply by 1.2)

out-of-state Get 80% of the default value (i.e., multiply by 0.8)

foreign Get 50% of the default value (i.e., multiply by 0.5)

Important!

This is an individual assignment. Students are NOT allowed to work together or seek help from

anyone else including current and former S308 students. Any questions about the assignment

should be sent to the instructor or the TA. Anyone found to have received help from another

person will receive a zero (0) for the assignment and will be reported for academic misconduct.

4. In addition, IUK Corp. would like to provide an extra $3,000 loan amount for undergraduate students

and an extra $5,000 loan amount for graduate students if applicants are IU students.

? If a student’s email domain equals to "iu.edu", then the student is an IU student.

Rules to calculate Yearly Interest Rate:

1. The following table provides a rule to decide interest rate.

Tuition Fees Loan Amount <= 30,000 Loan Amount > 30,000

$0 to $20,000 4.52% 4.21%

Over $20,000 to $50,000 3.83% 3.765%

Over $50,000 3.59% 3.15%

2. Lucky draw

(a) Summing up the value of an individual’s Day, Month, and Year of Birthday. (e.g. 06/15/1999 =>

6 + 15 + 1999 = 2020)

(b) If the value can be divisible by 4, the student gets an extra reduction of Interest Rate by 0.2%.

Tips:

1) Consider using the function TryParse() to test whether the string entered by the user is a

number.

2) Consider using one of the Round functions to round the number in your output.

Consider using ToString() to format your output.

3) Consider using the String methods to handle specific rule.

4) Use string function such as Splits and Convert functions to complete the lucky draw.

Grading Notes:

? Name you file ****_A2.zip where **** is your IU Network ID

? All applicable grading criteria from previous assignments will be applied to this assignment.

Including but not limited to:

o Assignment opens and runs without error.

o Well-designed user interface with appropriate controls, proper naming, labels,

title/instructions.

o The controls should be centered aligned horizontally and vertically (i.e. neatly ordered).

o Proper coding practices including organized easy-to-read code and appropriate data

type choices

? Include proper comments in your code.

Sample data to test your program:

This sample data is just for your reference. You should test your program with other data to make sure

it calculates correctly.

Input

Email temp@iu.edu

Student Type G

Resident Status in-state

Output

Loan Amount $65,000.00

Yearly Interest Rate 2.95%

Tuition Fee 55000

Birthday 09/04/1999


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp