Students: This content is controlled by your instructor, and is not zyBooks content. Direct…

Students: This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor. If you have any technical issues with the zyLab submission system, use the Trouble with lab button at the bottom of the lab. 1.8 HW5 This homework assignment gives you the opportunity to practice nested structures, passing a structure by reference, and dynamic allocation of an array of structures. There is an extra credit version worth an additional 5 points. HW5 (Graded out of 100) Write a program that manages bank accounts. Specically,
Students: This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor. If you have any technical issues with the zyLab submission system, use the Trouble with lab button at the bottom of the lab. 1.8 HW5 This homework assignment gives you the opportunity to practice nested structures, passing a structure by reference, and dynamic allocation of an array of structures. There is an extra credit version worth an additional 5 points. HW5 (Graded out of 100) Write a program that manages bank accounts. Specically, the program allows the user to enter the data related to an account, and list the data related to accounts. The data related to an account is maintained in the following structures: struct Person { string name; string address; }; struct Account { int accountNumber; Person ownerInfo; double balance; }; 1. Additional Requirements Make sure you meet all the requirements to avoid losing points a) Outline of main 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 2/14 Prompt the user to enter the maximum number of Accounts. Perform input validation. A valid value is an integer 0. Dynamically allocate an array of Accounts of the size entered by the user Display the menu of choices: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts, 4-Quit Perform input validation on the users choice. A users choice is valid if it is a choice on the menu. If the user chooses 1, prompt the user for the account data, do input validation on the account number and balance, and populate the next available element of the Account array. The next available element is the lowest index element that is not populated. If there is no available element (array is full), print an error message. Then display the menu again. If the user chooses 2, prompt the user for the account number. Perform input validation. If there is no account with that number, print an error message. Else, display the data related to the account. Then display the menu again. If the user chooses 3, print the data of all the accounts that have been populated. Then display the menu again. If the user chooses 4, terminate the program. For all the above input validations, the program should ask the user to reenter as long as the input is invalid, up to 5 attempts (the initial input counts as one attempt). If the maximum number of attempts is reached, the program prints an error message and terminates. An account number is valid if it is an integer 0 A balance is valid is it consists only of digits and at most one dot. If there is a dot, there are at most two digits after the dot. b) Functions You are required to implement your program with these functions. You may implement more functions to make your program more modular if you wish. populateAccount: This function takes as arguments the array of Accounts, the number of Accounts populated so far 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 3/14 passed by reference, and the size of the array passed by value. It prompts the user for the data and populates the next available element of the Account array. It performs all the necessary input validations. It prints an error message if there is no available element. The function returns void. printAccount: This function takes as argument an Account structure variable passed by reference. It prints the content of the structure variable. The function returns void. For the two above functions, you must use the proper qualier(s) to comply with the principle of least privilege. You will fail the unit test if you dont comply with the principle of least privilege. c) Style Make sure you follow the style requirements, especially regarding the comment header for functions, to avoid losing points. 2. Implementation Suggestions You are not required to implement the suggestions For the input validation, you can use getline to read the users input. You are allowed to use any of the existing library functions in chapter 10 of the Gaddis textbook to check input validity. You are also allowed to reuse code that you wrote for the previous homeworks. 3. Extra credit You can earn 5 points extra credit if your program checks the account number entered at choice 1 is not a duplicate of an existing account. If it is a duplicate account number, the program asks the user to reenter, up to 5 attempts (the initial input counts as one attempt). After 5 unsuccessful attempts, the program prints an error message and terminates. 4. Grading Criteria a) Source code inspection (grader) Style: 10 points (refer to the Homework Notes for the style requirements) If the code does not do dynamic array allocation, 20 points will be deducted b) Program compilation and execution (zylabs) 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 4/14 Test-1 Array creation with input validation and menu display Output starts like output-1: 3 points. Test-2 Array creation with input validation, max number of attempts reached Output matches output-2: 3 points. Test-3 Display menu with input validation, max number of attempts reached Output matches output-3: 3 points. Test-4 Enter data for an account with input validation on the data Output matches output-4: 9 points Test-5 Enter data for an account with input validation on the data, max number of attempts reached Output matches output-5: 3 points Test-6 Enter data for an account, array full Output matches output-6: 8 points Test-7 Enter data for an account, array full Output matches output-7: 8 points Test-8 Display data for an account with input validation on the account number Output matches output-8: 7 points Test-9 Display data for an account, no account found Output matches output-9: 7 points Test-10 Display data for all accounts Output matches output-10: 19 points Test-11 (Extra credit) Enter data for an account with input validation, extra credit Output matches output-11: 5 points Test-12 populateAccount unit test: 10 points Test-13 populateAccount-full unit test: 5 points Test-14 printAccount unit test: 5 points 5. Screen Outputs Below are the screen outputs you should see when running your code on an IDE. Enter max number of accounts: -1 Invalid value, please reenter: -2 Invalid value, please reenter: 2 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 4 Output-1 Enter max number of accounts: &% ^ Invalid value, please reenter: 9IO 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 5/14 Invalid value, please reenter: -1 Invalid value, please reenter: 200. Invalid value, please reenter: +- Too many unsuccessful attempts, exiting Output-2 Enter max number of accounts: 3 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: $4 Invalid choice, please reenter: a b Invalid choice, please reenter: 5 Invalid choice, please reenter: 0 Invalid choice, please reenter: 1. Too many unsuccessful attempts, exiting Output-3 Enter max number of accounts: 5 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 100a Invalid value, please reenter: #200 Invalid value, please reenter: 1 100 Invalid value, please reenter: 100 Enter balance: $4000 Invalid value, please reenter: %500 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 6/14 Invalid value, please reenter: 60 7 Invalid value, please reenter: 1000 Enter owner's name: Han Solo Enter owner's address: 5 Galaxy Way Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 4 Output-4 Enter max number of accounts: 4 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 200* Invalid value, please reenter: #$ cb Invalid value, please reenter: (90) Invalid value, please reenter: 100.005 Invalid value, please reenter: qwer Too many unsuccessful attempts, exiting Output-5 Enter max number of accounts: 2 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 7/14 Enter account number: 100 Enter balance: 1000.8 Enter owner's name: Chewie Enter owner's address: 800 W Comet Way Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 200 Enter balance: 2000.11 Enter owner's name: R2 D2 Enter owner's address: 800 W Galaxy Way Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Cannot execute, array is full Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 4 Output-6 Enter max number of accounts: 1 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 8/14 Enter account number: 300 Enter balance: 3000 Enter owner's name: Mr. Spock Enter owner's address: 5 Enterprise Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Cannot execute, array is full Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 4 Output-7 Enter max number of accounts: 3 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 100 Enter balance: 100.99 Enter owner's name: Uhura Enter owner's address: 5 Enterprise Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 9/14 Enter account number: 200 Enter balance: 50.1 Enter owner's name: Mc Coy Enter owner's address: 6 Enterprise Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 2 Enter account number: 100. Invalid value, please reenter: 100# Invalid value, please reenter: 100 Account #: 100 Owner's name: Uhura Owner's address: 5 Enterprise Balance: 100.99 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 4 Output-8 Enter max number of accounts: 3 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 100 Enter balance: 100.99 Enter owner's name: Uhura 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 10/14 Enter owner's address: 5 Enterprise Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 200 Enter balance: 50.1 Enter owner's name: Mc Coy Enter owner's address: 6 Enterprise Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 2 Enter account number: * 100 Invalid value, please reenter: 300 Account not found Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 4 Output-9 Enter max number of accounts: 5 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 100 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 11/14 Enter balance: 1000.11 Enter owner's name: Chewbacca Enter owner's address: Starfleet 1 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 500 Enter balance: 5000.5 Enter owner's name: L Skywalker Enter owner's address: Starfleet 2 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 3 Account #: 100 Owner's name: Chewbacca Owner's address: Starfleet 1 Balance: 1000.11 Account #: 500 Owner's name: L Skywalker Owner's address: Starfleet 2 Balance: 5000.5 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 4 Output-10 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 12/14 Enter max number of accounts: 3 Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 20 Enter balance: 201.25 Enter owner's name: Mr. Chekov Enter owner's address: 3 Enterprise Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 10 Enter balance: 123.45 Enter owner's name: Obi-Wan Enter owner's address: 4 Enterprise Menu: 1-Enter data for specific account, 2-Display data for specific account 3-Display data for all accounts , 4-Quit: 1 Enter account number: 10 Duplicate account number Output-11 LAB ACTIVITY 1.8.1: HW5 0 / 95 Submission Instructions 2/22/2020 1.8. HW5 https://learn.zybooks.com/zybook/UTDALLASCECSTE1337LeSpring2020/chapter/1/section/8 13/14 Downloadable les in3.txt , in1.txt , in4.txt , in2.txt , in5.txt , in10.txt , in11.txt , in8.txt , in6.txt , in9.txt , and in7.txt Compile command g++ main.cpp -Wall -Wextra -pedanticerrors -pedantic -o a.out We will use this command to compile your code Upload your les below by dragging and dropping into the area or choosing a le on your hard drive. main.cpp Drag le here or Latest submission No submissions yet Download Choose on hard drive. Submit for grading Trouble with lab?

View less

Custom Paper Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.