SMB4103-Introduction to Programming Page 1 of 5 SMB4103-Introduction to Programming Semester 1, 2017 Practical Assignment (30 Marks) Topics Covered  Designing a Java application  Java I/O and Data types  Control Structure-Decision  Control Structure-Loops  String Handling  Arrays and Array lists  Exception Handling  Files I/O and streams Background A branch of the Australian taxation office has hired you as a contract programmer. Your first assignment is to write a Java complete program to access employee profile and calculate the tax rate for each employee. The user has first to enter the user name and password to access to their profile. When the login details are not correct, the program asks the user to re-enter login details again. A text based menu appear to the user for access the profile when the user provides correct login details (correct user name and password). The menu offers the user to display profile or modifying any field in addition to calculate the tax rate. The tax rate can be calculated according to the following table: Salary (S) Tax Tate (T) 0-$20,000 T=0 Over 20,000-40,000 T= (S-20,000) *0.2 Over 40,000-90,000 T= (S-40,000) *0.35+4,000 Over 90,00-180,000 T= (S-90,000) *0.4+20,000 Over 180,000 T= (S-180,000) *0.45+50,000 For example is the user salary is $50,000, the tax rate is (50,000-40,000)*0.35+4,000 = $7,500 SMB4103-Introduction to Programming Page 2 of 5 Task Specifications You are required to write a Java console program using Netbeans IDE. Your task is to design and code a Java program that will achieve the following:  On starting load the use details from a text file that is provided. Your program must display an error message if the file is not found or if there is no data.  Display a message asking the user to enter user name and password. The program must display incorrect login message and ask the user to re-enter login details if the user enter incorrect user name or password.  Display a menu when the user entered correct login details. The menu asks the user to select: display user profile, modify user profile, tax rate or exit.  If the user chooses to display user profile the program display all the user profile for the login user and shows the menu again.  If the user chooses to modify user profile the program must allow the user to enter new profile and update the user details in the text file and shows the menu again.  When the user chooses tax rate, the program calculates and display the tax rate according to the user salary. The program then shows the menu again.  The program terminates when the user select exit.  Program should be properly commented and indented. Following is a demonstration of sample output of program after execution: Enter User name: User2 Enter Password: 1312 Incorrect user name or password Enter User name: User2 Enter Password: 1313 Choose one from the followings: D: Display user profile, M: Modify user profile, T: Tax rate, E: Exit. D User2 1313 Address2 50000 Choose one from the followings: D: Display user profile, M: Modify user profile, T: Tax rate, E: Exit. SMB4103-Introduction to Programming Page 3 of 5 T The Tax rate is: $7,500 Choose one from the followings: D: Display user profile, M: Modify user profile, T: Tax rate, E: Exit. E Thank you for using this application. The marking scheme will show you how marks will be allocated for this assessment. The program does not have to be completed to earn marks but your submission must be satisfactory and a reasonable attempt. See the general instructions in OLS for clarification of satisfactory and reasonable. If you have any queries about the assignment, please use the discussion board. Sample of Text file to be used in this program: User Name Password Address Salary (AU$) User1 1212 Address1 60000 User2 1313 Address2 50000 User3 1414 Address3 70000 User4 1515 Address4 80000 User5 1616 Address5 75000 Submission requirements • This assignment can be done in group of 4 people depending on class size. The group size will be decided by your lecturer. • This assignment solution must be your own work. You must not copy any source code from the text book or internet. You must write your own source code to show that you understand the course material and show that you can apply it. • Do not allow others to copy your work. • Follow the marking rubric to score good mark in this assessment. • Create one zip file that should contain the following and Submit it to the practical assignment submission link on OLS. SMB4103-Introduction to Programming Page 4 of 5 Your zip file must contain:  All .java source code files of your Java Project so that your program can be run (you may use the src folder in the NetBeans directory)  Text file that is created by your program  Word document with appropriate headings and formatting and It should contain the following: o Print screens of all your error messages displayed to the user o Print screens of the data entry while entering menu options and output o Any assumptions you have made SMB4103-Introduction to Programming Page 5 of 5 Marking Scheme SMB4103- Introduction to Programming Semester 1, 2017 Practical Assignment (Worth 30%) Marking Guide Group Name: ___________________ Group member’s name Student ID 1 2 3 4 Trait Task Detail Possible Mark Comments Readability No more than one blank line at a time 1 No indent error 1 No non-meaningful name 1 One blank line separates sections of code 1 White space around all operators (allow one error) 1 No line exceeds 80 characters 1 Only one statement per line 1 Blocks correctly aligned 1 Documentation Introductory comments provided 1 Method comments provided 1 Variables/constants commented 1 Comments are useful 1 No unused variables/unreachable code/warnings 1 Variables initialised 1 Reusability Methods have been used 2 Parameters used 1 Return type used 1 File handling Data is written to file correctly 2 Data can be read from file correctly 2 File closed after use 1 Use of Try Catch 1 Specifications Shows correct menu options 1 Calculations are correct as per given specifications 1 Exits from the program correctly 1 Delivery Code delivered on time 1 Efficiency No other errors 1 Overall quality of program 1 30