帮做ITECH1400、Python语言代做、Python设计代写、Python语言程序代写帮做Haskell程序|代写Database

ITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 1 of 10ITECH1400 - Assignment 2 – FedUni BankingDue Date: 5pm, Friday of Week 11This assignment will test your skills in designing and programming applications to specification and is worth20% of your non-invigilated (type A) marks for this course. This is an INDIVIDUAL ASSIGNMENT – and whileyou may discuss it with your fellow students, you must not share designs or code or you will be in breach ofthe university plagiarism rules. This assignment should take you approximately 20 hours to complete.Assignment OverviewYou are tasked with creating an application that uses a GUI that simulates a simple banking interface similar toan ATM / online banking using the Python 3 programming language.The assignment is broken up into five main components:1.) The ability to provide an account id and a PIN (PersonalIdentification Number) to sign into a bank account,2.) The ability to view the balance of the bank account andto deposit and withdraw virtual money into and outfrom the account,3.) The ability to save transactions via file storage so thatyou can log in, deposit some money and then log out –and when you log back in that money is still there, andfinally4.) The ability to display a graph of projected earnings onthe bank account via the compound interest accruedover a variable amount of time.5.) A Test Case that ensures your BankAccounts depositand withdraw functionality operates correctly.Your submission should consist of three Python scripts that implement this application as described in thefollowing pages: bankaccount.py, main.py along with a testbankaccount.py which contains a small test casewith a few simple unit tests than ensure that your bank accounts deposit and withdraw methods operatecorrectly.You are provided with a stub of each of these files which contain all the function declarations and commentswhich describe the role of the function and how it can be put together, but you will have to write the code forvast majority of the functions yourself. You are also provided with a stub of the bankaccounttestcase.py file.Your final submission should be a zipped archive (i.e. ‘zip file’) containing your completed Python scripts.There is no word processed component to this second assignment.ITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 2 of 10Bank Account Class DesignThe design for a BankAccount object is laid out in the following class diagram:As you might imagine, the deposit(amount) function adds that money to the current balance of the account,and the withdraw(amount) function removes (i.e. subtracts) money from the current balance of the account.Each transaction in the transaction_list is a tuple containing either the word Deposit or the word Withdrawalfollowed by an amount, for example: (Deposit, 300.0) or (Withdrawal, 100.0).The bank accounts in our program do not have an overdraft facility so the user cannot withdraw money theydo not have – that is, if they had $200 in their account and they tried to withdraw more than $200 then theoperation should fail and the withdraw function should raise an Exception with a suitable error message whichis caught and displayed in the main.py file where the operation was attempted.All error messages such as those from exceptions should be displayed in a pop-up messagebox.The get_transaction_string method should loop over all the transactions in the transaction_list creating a stringversion (with newline characters) of all the transactions associated with the account.The export_to_file function should save the account_id, pin_number, balance, and interest_rate in that orderto a file called .txt followed by the transaction list string generated from theget_transaction_string() method. The name of the account file is NOT .txt - the name of the fileis the ACTUAL ACCOUNT ID followed by .txt, so for an account with account_id 123456 the name of theaccount file would be 123456.txt.A full ‘walk-through’ video demonstrating the completed application and how it operates will be provided alongwith this assignment document.BankAccountaccount_id: intpin_number: stringbalance: floatinterest_rate: floattransaction_list: list of two-tuplesdeposit(amount)withdraw(amount)get_transaction_string()export_to_file()ITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 3 of 10Calculating InterestTo make it worthwhile for you to keep your money with a bank, the bank offers you an interest rate on yoursavings. Interest will be applied to the balance of an account once per month.Let’s do an example – suppose you had $10,000 in a bank account and the bank paid you monthly interest at arate of 3% per year. That would mean the bank pays you 3% of your balance divided by 12 (because there are12 months in a year) per month. If we start our example on January and run it for a few months (and we don’tdeposit or withdraw any money throughout the year) then we end up with our bank balance changing like this:Note: 3% divided by 12 is 0.25% per month – so we’ll multiply our balance by 1.0025 to get the new balance.Jan Feb Mar Apr May Jun Jul Aug Etc.10,000.00 10,025.00 10,050.06 10,075.19 10,100.38 10,125.63 10,150.94 10,176.32 …What’s happening here is that the interest is compounding – which just means that we get that 0.25% appliednot only to our principle balance (i.e. the $10,000 we started with), but it also gets applied to the interest weearnt. Although 3% interest is very low (but in line with the best rates you’d get in Australia at the momentbecause interest rates are very low), over time this compounding makes a serious difference!Because FedUni Bank is the greatest bank of all time, it offers all accounts an interest rate of 33%.The Main Python ScriptOur main.py script will contain all the main logic for our program. It will allow us to:- Enter an account id via an Entry field by using the keyboard,- Enter a PIN number via an Entry widget (we can use the keyboard OR a series of buttons to enter thePIN),- Once we are logged in we must be able to:o See the balance of our account,o Deposit funds into our account,o Withdraw funds from our account (only up to the amount we have available),o Display a plot of our projected interest over the next 12 months as outlined above, and finallyo Log out of our account.Every time a successful deposit or withdrawal is made then a new transaction should be added to the accountstransaction list. When we log out then the account file is overwritten with the new account details includingour new balance and any transactions if any have been made.The format of the account text file is as follows (each value on separate lines):account_idaccount_pinbalanceinterest_rateITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 4 of 10For example, account id 123456 with PIN 7890 and a balance of $800 with an interest rate of 33% would looklike this:1234567890800.000.33After these first four lines we may have a number of transactions, each of which is specified as two lines. Adeposit is indicated by the word Deposit on one line and then the amount on the next like. For example adeposit of $500 would look like this:Deposit500.00Similarly, a withdrawal is also specified as two lines – first the word Withdrawal and then on the next line theamount, for example a withdrawal of $200 would look like this:Withdrawal200.00You are provided with an example bank account file called 12345678.txt – this file along with others will beused to mark your assessment, so you should make sure that your final submission can use bank accounts inthis format successfully.You are also provided with a video demonstration of the completed assignment along with this document. Yourapplication should match this user interface and function in the same way.Login ScreenWhen the application is first launched, it should open a window that is 440x640 pixels in size (use the windowobject’s geometry function to set this). Set the title of the window to FedUni Banking using the top-levelwindow objects winfo_toplevel().title() function.The window uses the GridManager layout manager for placing GUI elements (e.g. widgets), it contains a Labelthat spans the top of the window saying FedUni Banking (font size is 32). On the next line is a label sayingAccount id and then an Entry widget for the user to type in their account id and an Entry for the PIN number.It then has a series of buttons from 0 through 9, along with a Log In button and a Clear/Cancel button.Each time a number is pressed it is added to a string - for example, if the user pushed the 4 button then the 3button then the 2 button and then the 1 button then the string should contain the text 4321. By using theshow=* attribute you can mask the input so that anyone looking over your shoulder cannot see the exactpin number, theyll just see **** instead. When the Clear/Cancel button is pressed, or when a user logs outthen this PIN string should be reset to an empty string.When the Log In button is pressed then the program should attempt to open the file with the account idfollowed by .txt - so in the example below, because the account id entered was 123456, the program willattempt to open the file 123456.txt.ITECH1400 – Foundations of Programming帮做ITECH1400作业、Python语言代做、Python课程设计代写、Python语言程序代写留学生 帮做HaskSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 5 of 10If that file could not be opened then a messagebox should display a suitable error message such as Invalidaccount id - please try again!. You will have to try/catch this risky functionality to avoid the program crashing- see the week 7 lecture materials if you need a recap.If the account exists, then a BankAccount object should be created and the fields of the BankAccount objectshould be set (e.g. account_id, pin_number, balance, interest_rate, and the transaction_list).Because you dont know how many transactions are stored for this bank account, after reading the first fourlines you will need to attempt to read two lines and if they exist create a tuple of the transaction (i.e. its typeand amount) and then add it to the BankAccount objects transaction_list - for example you may do thefollowing in a loop:# Try to read a line, break if weve hit the end of the fileline = read_line_from_account_file()if not line:breakelse:# read another line, create a tuple from both lines and append the# tuple to the the BankAccount objects transaction_listITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 6 of 10Account ScreenThe account screen has:- A large FedUni Banking label at the top that spans 5 columns (font size is 24),- A label with the account id followed by the actual account id displayed,- A label with the current balance followed by the actual balance,- A log out button which saves the bank account file (overwriting it) and causes all widgets to beremoved from the screen and the log in screen displayed again,- An Amount label followed by an amount Entry widget where you can type in how much to deposit orwithdraw,- Deposit and Withdraw buttons that deposit or withdraw funds using the BankAccount classes methodsto do so,- A Text widget (i.e. multi-line text) that shows all the transactions associated with the account. Theheight of this widget is 10 lines and the width of the widget is 48 characters.- To the right of the Text widget this is a scrollbar which can be used to scroll the Text widget (it is notreally showing in the above screenshot because the Text widget does not have more than 10 linesworth of content), and finally- A small graph of the projected cumulative interest over the next 12 months.ITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 7 of 10Bank Account Test CaseThe final thing to do is to add a small test case consisting of five unit tests that ensure that the BankAccountclass deposit and withdraw methods operate correctly.You are provided with a stub of a testbankaccount.py test case that already has the definitions of the five unittests that you will write and a description of what they are testing. Your job is to write suitable assert statementsinto each of these unit tests so that they ensure the BankAccount classs deposit and withdraw functions dooperate as they should. You should be able to accomplish each unit test in a maximum of two lines of code perunit test.Two things to remember:1.) The setUp method is automatically executed before each unit test, so the balance gets reset to 1000.0before each test, and2.) If your unit test fails (and the test is correct) then you should modify your code so that it passes thetest, not the test so that it matches up with what your code is doing!Development and Marking TipsYou will need to bind all the numerical log in buttons to the event and the same function, andthen extract which button was pressed to help build up the PIN number text. To extract which widgettriggered the function use event.widget[text].You are provided with the complete function to remove all widgets from the top level window, the function toread a line from the account file which does NOT include the final \n newline character and most of thecode to generate a graph and place it in your window - so you do not have to write these yourself.The grid for the login screen has 3 columns and 6 rows, while the grid for the account screen has 5 columnsand 5 rows. The fifth column on the account screen is the one holding the scrollbar.Once you have your login screen working, it makes sense to set the account id variable and PIN numbervariables to 123456 and 7890 respectively so that they are already filled in when you launch the app andyou can immediately click the Log In button to move to the account screen. Without this you will have toenter these values each time you run the program, which will be a nuisance.When you are writing your code to save the bank account object to file be aware that if the function failsbefore closing the file then the file will now be blank (i.e. it will not contain any bank account details). As such,its probably best to keep a copy of the file close by so you can replace it if necessary.The way this assignment is marked is a little different from assignment 1 where you could get marks for effort- that is, if something didnt quite work as it should you would still get marks. This was because you weredesigning the code and its logical flow. In this assignment you are given a precise specification of how theapplication should work, and the marking guide is more along the lines of did you implement this feature asspecified?, did you implement that feature as specified?.ITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 8 of 10The answer to these questions is largely a simple yes or no - if you did, you get the mark - and if you didntthen you dont get the mark. If your code doesnt run at all (i.e. it produces an error on startup) then it meansyour code cannot possibly implement the functionality, and your marks will be severely affected. Nobodywants this - so even if you do not implement the entire suite of functionality, please make sure that your codeat least runs!As a final reminder, please do not add functionality that is not described in this document. Rather thanbeing rewarded with extra marks you will be penalised for not matching the project specification - so pleasestay on spec!Submission and Marking ProcessYou must supply your program source code files as a single compressed archive called:ITECH1400_Assignment_2__.zipObviously replace and Assignments will be marked on the basis of fulfilment of the requirements and the quality of the work. Inaddition to the marking criteria, marks may be deducted for failure to comply with the assignmentrequirements, including (but not limited to):? Incomplete implementation,? Incomplete submissions (e.g. missing files), and? Poor spelling and grammar.Submit your assignment to the Assignment 2 Upload location on Moodle before the deadline of Friday of week11 at 5pm.The mark distribution for this assignment is explained on the next page – please look at it carefully and compareyour submission to the marking guide.ITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 9 of 10Assignment 2 – FedUni BankingStudent name: Student ID:Item Assessment Criteria Weight Mark1 Window is correct size of 440x640 with title of FedUni Banking 12 FedUni Banking label is displayed in large font across top of login screen 13 Account id / PIN label exists near top left of login screen 14 Clicking PIN entry buttons result in adding that number to pin entry 15 All PIN number input is masked to be asterisks (i.e. **** not 7890) 16 Incorrect account id results in suitable error message box 17 Incorrect pin results in suitable error message box 18 Cancel / Clear button clears PIN entry only 19 Login button with valid account id and PIN logs in to account screen 110 FedUni Banking label is displayed across top of account screen 111 Account id is displayed on account number label 112 Account balance is displayed on account balance label 113 Log out button exists and returns user to login screen 114 Log out button saves account details to account file with any changes made 115 Amount label exists 116 Amount entry exists 117 Deposit button exists 118 Withdraw button exists 119 Clicking Deposit with legal value in amount entry adds to balance and add asuitable account transaction220 Clicking Deposit with illegal value results in suitable error message box 121 Clicking Withdraw with legal value in amount entry subtracts from balanceand adds a suitable account transaction222 Clicking Withdraw with illegal value results in suitable error message box 123 Clicking Withdraw with insufficient funds results in suitable error message box 1ITECH1400 – Foundations of ProgrammingSchool of Science, Engineering and Information TechnologyCRICOS Provider No. 00103D Page 10 of 1024 Multiline Text widget showing account transactions exists 125 Any new valid transaction made is displayed in the multiline Text widget 126 Multiline Text widget has a scrollbar which can scroll the text 127 Graph of interest exists and is correct for current balance showing next 12months cumulative interest at bank account rate of 33% per annum228 Graph of interest is updated when balance changes 129 BankAccount unit tests correctly test deposit / withdraw functionality 5Assignment total (out of 36 marks)Contribution to grade (out of 20 marks)Comments:转自:http://ass.3daixie.com/2018092722237660.html

你可能感兴趣的:(帮做ITECH1400、Python语言代做、Python设计代写、Python语言程序代写帮做Haskell程序|代写Database)