” COMP1038编程语言 辅导、 写作DigitalCOMP1038 Coursework 02 Digital MiniBanking SystemIntroductionThis is the COMP1038 Coursework 02. It is worth 40% of the module mark. Thedeadline for this exercise is 16:00 on Saturday 26th of December 2020.Read the entire document before beginning the exercise.If you have any questions about this exercise, please ask in the QA forum onMoodle, after a lecture, in a lab, or during the advertised office hours. Do not postyour program or parts of your program to Moodle as you are not allowed to share yourcoursework programs with other students. If any questions require this exercise to beclarified then this document will be updated and everyone will be notified via Moodle.Version History Version 2.0 – 2020-12-04 version 2.SubmissionYou must submit a single C source code file containing all your code for this exerciseand a text file containing city names, branch names, and their codes. The files must becalled DigitalMiniBank_Your_Name_Your Numeric Id.c andCityBranchCodes_Your_Name_Your Numeric Id.txt. The program must notrequires any other files outside of the standard C headers which are always available.The first line of the C source code file should be a comment which contains yourstudent ID number, username, and full name, of the form:// 6512345 zy12345 Joe BlogsThe file must compile without warnings or errors when I use the commandgcc -std=c99 -lm -Wall DigitalMiniBank_Your_Name_Your Numeric Id.c -oMiniBankAccountThis command will be run on our Linux server cslinux. If it does not compile, for anyreason, then you will lose all the marks for testing (common reasons in the past havebeen submitting a file with the wrong filename, or developing your solution on yourpersonal computer without having tested it on our Linux server). If the file compilesbut has warnings then you will lose some marks for not correcting the warnings.The completed source code file should be uploaded to the Coursework Submissionlink on the COMP1038 Moodle page. You may submit as many times as you wishbefore the deadline (the last submission before the deadline will be used). After thedeadline has passed, if you have already submitted your exercise then you will not beable to submit again. If you have not already submitted then you will be allowed tosubmit once.Late submissions: Late submissions will lose 2 percentage points per hour, roundedup to the next whole hour. This is to better represent the large benefit a small amountof extra time can give at the end of a programming exercise. No late submissions willbe accepted more than 50 hours after the exercise deadline. If you have extenuatingcircumstances you should file them before the deadline.PlagiarismYou should complete this coursework on your own. Anyone suspected of plagiarismwill be investigated and punished in accordance with the university policy onplagiarism (see your student handbook and the University Quality Manual). This mayinclude a mark of zero for this coursework.You should write the source code required for this assignment yourself. If you usecode from other sources (books, web pages, etc), you should use comments toacknowledge this (and marks will be heavily adjusted down accordingly). The onlyexception to this is the dynamic data-structures (linked lists and others) developedduring the lectures and tutorials; you may use these, with or without modification,without penalty as long as you add a comment in your program saying you have takenthem from the lectures or tutorials and saying how you have modified it (or notmodified it). If you do not acknowledge their source in a comment then it will beregarded as potential plagiarism.You must not copy or share source code with other students. You must not worktogether on your solution. You can informally talk about higher-level ideas but not toa level of detail that would allow you all to create the same source code.Remember, it is quite easy for experienced lecturers to spot plagiarism in source code.We also have automated tools that can help us identify shared code, even withmodifications designed to hide copying. If you are having problems you should askquestions rather than plagiarize. If you are not able to complete the exercise then youshould still submit your incomplete program as that will still get you some of themarks for the parts you have done (but make sure your incomplete solution compilesand partially runs!).If I have concerns about a submission, I may ask you to come to my office andexplain your work in your own words.MarkingThe marking scheme will be as follows: Tests (60%): Your program should correctly implement the task requirements.A number of tests will be run against your program with different input datadesigned to test if this is the case for each individual requirement. The teststhemselves are secret but general examples of the tests might be:o Does the program work with the example I/O in the question?o Does the program work with typical valid input?o Does the program correctly deal with input around boundary values?o Does the program correctly deal with invalid input (both invalid files andvalues)?o Does the program handle errors with resources not being available (eg,malloc failing or a filename being wrong)?o Does the program output match the required format?o Does the program output an appropriate table when required?As noted in the submission section, if your program does not compile thenyou will lose all testing marks. Appropriate use of language features (30%): Your program should use theappropriate C language features in your solution. You can use any languagefeatures or techniques that you have seen in the course, or you have learned onyour own, as long as they are appropriate for your solution. Examples of thismight be:o If you have many similar values, are you using arrays (or equivalent)instead of many individual variables?o Have you broken your program down into separate functions?o Are all your function arguments being used?o If your functions return values, are they being used?o If you have complex data, are you using structures?o Are you using loops to avoid repeating many lines of code?o Are your if/switch statements making a difference, or are the conditionsalways true or false making the statement pointless?o Are you closing files when the file is no longer in use? Source code formatting (10%): Your program should be correctly formattedand easy to understand by a competent C programmer. This includes, but is notlimited to, indentation, bracketing, variable/function naming, and use ofcomments.TaskNowadays, bank accounts have become an important part of human life for savingmoney easy and safe way. Due to the recent growth of digitization, most of the banksare maintaining the accounts of their customers on a computerized system. As abanking software developer, your task is to develop a computerized banking system.When the program runs, it should display the following main menu to the user andprompt them to enter a menu option:1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:If the user enters the number of an option, the program should perform that optionthen return to the main menu to let the user select another option. If the user enterssomething which is not a valid option then the program should print Unknownoption. then print Option: again for the user to select another option. The usermay enter any input at this, or any other prompt, in the program, terminated bypressing the return key (newline character). Your program must deal with thisappropriately, accepting valid input and rejecting invalid input according to theparticular prompt.If the user selects Show city code and branch code, then the program will show thelist of city and city codes, and a prompt Enter the city code:. When the userenters a city code from the list, it will display list of branches within that city and theircodes. For doing this, the students need to prepare a text file containing city namesand branch names and their codes. The file shoud contains at least 10 city names, 5branch name from each city, and their respective codes.If the user selects Open an account, then the program should ask the user to inputflowing data.Description Type Size RemarksName String 100 charactersId Number String 15 Characters Id can be alphanumericAddress String 200 CharactersDate of Birth String 10 Characters YYYY/MM/DDInitial deposit Integer not less than 1000 RMBAfter inputting these data of an account the account will be created and a numericaccount number will be assigned by the program in the format of xxxxxxxxxx. Thefirst xxx is the city code which is a number within 001-999 from the list of city codes,the second xx is the branch code which is a number within 01-99 from list of branchcodes, and the third xxxxx is the account number which is a number within 00001-99999. Account number will be assigned in sequence starting with 00001. With thesame city code and same branch code, two account numbers cant be the same.Todays date (system date) will be associated with the account by the program as theaccount opening date.If the user selects Show account details, then the program should ask the user toinput the account number and the program will display all the information about theaccount.If the user selects Show list of accounts, then the program should ask the user toinput the city code and the branch code. The program will display a table as follows.Account Number Name Id Number BalanceIf the user selects Deposit in an account, then the program should ask the user toinput the account number and show the details of the account and prompt for input theamount in integer by the user. After input, the amount will be added with thecorresponding accounts balance and display the new account balance.If the user selects Withdraw from an account, then the program should ask the userto input the account number and show the details of the account and prompt for inputthe amount in integer by the user. After input, the amount will be deducted from thecorresponding accounts balance and display the new account balance. If thewithdrawal amount is more than the balance in the account the program will showWithdrawal amount cant be more than the balance in the account and ask for thewithdrawal amount again.If the user selects Transfer money, then the program should ask the user to input theaccount number of the debiting account and display the name, Id, and balance of theaccount. Thereafter, the program will ask the user to the input account number of thecrediting account and display the name, Id, and balance of the account. Then theprogram will ask the user to input the transfer amount. If the transfer amount is morethan the balance in the debiting account the program will display Transfer amountcant be more than the balance of the debiting account and the program will ask theuser to input a new transfer amount. Thereafter, if the transaction is successful, thetransfer money will be deducted from the balance of the debiting account and will beadded with the balance of the crediting account and show the message Transactionsuccessful. Then the program will keep a record of this transaction by storing theDebiting account number, Crediting account number, transfer amount, and the date ofthe transaction. If the transaction is unsuccessful, the program will displayTransaction unsuccessful.If the user selects Transaction details, then the program should ask the user toinput the account number, start date, and end date. The dates will be input inYYYY/MM/DD format. If the end date is more recent than the start date the programwill display End date cant be later than the start date. Else the program will displaya list of all transactions between the start and end date in the form of a table asfollows.Date Debiting account Crediting account Transfer amountRecords in the table will be arranged in ascending order based on date. i.e. the recordfor the most recent transaction will be on the top of the table.If the user selects Close an account, then the program should ask the user to inputan account number and display the account details. Thereafter, it will show a promptfor the confirmation from the user for closing the account. If the user confirms toclose the account, the corresponding records of the account will be deleted from thefile holding the information of the list of the accounts and move to the list of theclosing accounts file. After closing an account the corresponding account number willnot be given to any other user.If the user selects Quit, then the program should terminate. Before exiting, theprogram should explicitly free any main memory it has allocated that it hasnt yetfreed. (Note that most operating systems will recover all unfreed memory from aprogram when it exits but this exercise requires you to free allocated memory yourselfin order to demonstrate you can do it). The program also closes all the open filesbefore existing.After every operation, the program will ask the user if the user wants to do the sameoperation again or return to the main menu. The program will proceed with itsexecution according to the users decision.Example input/output1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:1City code City code City CodeNingbo 001 Beijing 002 Chongqing 003Shanghai 004 Tianjin 005 Anqing 006Bengbu 007 Bozhou 008 Chaohu 009Enter the city code: 001Branch name code Branch name code Branch name CodeYinzhou 01 Fenghua 02 Ninghai 03Xiangshan 04 Beilun 05 Haishu 06Jiangbei 07 Zhenhai 08 Yuyao 09Cixi 10Do you want to see more city and branch codes (Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:2Enter the name of the account holder: John BraviaEnter the Id number of the account holder: E145326780009Enter the address of the account holder: 1A Brandon Road, Guangzhou, China-3210011Enter the DoB of the account holder: 1980/05/11Enter the initial balance of the account (not less than 1000 RMB): 800Initial deposit cant be less than 1000 RMBEnter the initial balance of the account (not less than 1000 RMB): 1500The account number is: 1011212345Do you want to open more accounts?(Y/N): YEnter the name of the account holder: Hao LiuEnter the Id number of the account holder: E175526740307Enter the address of the account holder: 2B Hansui Road, Ningbo, China-312101Enter the DoB of the account holder: 1985/07/21Enter the initial balance of the account (not less than 1000 RMB): 800Initial deposit cant be less than 1000 RMB.Enter the initial balance of the account (not less than 1000 RMB): 1200The account number is: 1231514327Do you want to open more accounts?(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:3Enter an account number: 1011212345Name of the account holder: John BraviaId number of the account holder: E145326780009Address of the account holder: 1A Brandon Road, Guangzhou, China- 3210011DoB of the account holder: 1980/05/11Balance of the account: 1500Date of opening: 2020/11/19Do you want to see the details of more accounts?(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:4Enter the city code: 101Enter the branch code: 12Account Number Name Id Number Balance1011212345 John Bravia E145326780009 1500Do you want to see more account lists(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:5Enter the account number: 1011212345Name of the account holder: John BraviaId number of the account holder: E145326780009Balance of the account: 2000Enter the deposit amount: 500New account balance is: 2500Do you want to deposit in another account(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:6Enter the account number: 1011212345Name of the account holder: John BraviaId number of the account holder: E145326780009Balance of the account: 1500Enter the withdrawal amount: 2500The withdrawal amount cant be more than the balance in the account.Enter the withdrawal amount: 500New account balance is: 1500Do you want to withdraw in another account(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:7Enter the debiting account number: 1011212345Name of the account holder: John BraviaId number of the account holder: E145326780009Balance of the account: 1500Enter the crediting account number: 1231514327Name of the account holder: Hao LiuId number of the account holder: E175526740307Balance of the account: 1200Enter the transfer amount: 1600Transfer amount cant be more than the balance of the debiting account.Enter the transfer amount: 200Transaction successfulBalance of the account 1011212345 is: 1300Balance of the account 1231514327 is: 1400Do you want to do more transfer(Y/N): YEnter the debiting account number: 1011212345Name of the account holder: John BraviaId number of the account holder: E145326780009Balance of the account: 1300Enter the crediting account number: 1231514327Name of the account holder: Hao LiuId number of the account holder: E175526740307Balance of the account: 1400Enter the transfer amount: 100Transaction successful.Balance of the account 1011212345 is: 1200Balance of the account 1231514327 is: 1500Do you want to do more transfer(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:8Enter the starting date: 2020/11/19Enter the ending date: 2020/11/22End date cant be later than the start dateEnter the ending date: 2020/11/15Date Debiting account Crediting account Transfer amount2020/11/19 1011212345 1231514327 1002020/11/19 1011212345 1231514327 200Do you want to check more transaction details(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:9Enter an account number: 1011212345Name of the account holder: John BraviaId number of the account holder: E145326780009Balance of the account: 1200Do you want to close the account(Y/N): YAccount successfully closedDo you want to close more account(Y/N): N1) Show city code and branch code2) Open an account3) Show account details4) Show list of accounts5) Deposit in an account6) Withdraw from an account7) Transfer money8) Transaction details9) Close an account10)QuitOption:10Z2019024 $Hints You have efficiently utilized files to store account-related information. You have to appropriately create, read from, write into, and close files to storedata and process data. You should create as minimum files as possible. You need to close all the openfiles when they are no longer in use. Remember to free any main memory which you no longer need. Your programshould not have any main memory leaks (dynamically allocated areas ofmemory that are no longer reachable). You will need to consider how theresponsibility for allocated data transfers as your program runs. Your program should be able to handle some, if not all, invalid input entered byusers.END如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。