Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Program The program shall have these options: 1) Create new customer portfolios. 2) Create stock and bond accounts for the customer and invest funds.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

C++ Program

The program shall have these options: 1) Create new customer portfolios. 2) Create stock and bond accounts for the customer and invest funds. 3) Display information for one customer and their accounts. a) Display information for all customers and their accounts. 4) Display projections of the portfolio accounts value in the future. 5) Write a report to the screen and a file. 6) Write the data out to a database file. q) Quit out of the program The program design will be based on the structures abstract data type (ADT), using nested structures. Internally, a customer record shall consist of a customer data structure and an array of 5 customer accounts, and the data records shall be stored in a structure array. The customer data structure shall contain the following data: DATA DATA TYPE cus mer ID last name first name middle name tax ID number phone number account info[5] C-String (Length 5: A-Z,0-9) C-String C-String C-String C-String C-String Nested Structures (array of 5) The account info structure shall contain the following data: DATA DATA TYPE account ID account balance growth rate compounded per year C-String (Length 6: A-Z,0-9) Floating Point Type Floating Point Type Integer Type The main() function shall act only as an executive, controlling the flow of the program, but not implementing low-level details of it. No global variables shall be used. Variables needed by more than one function, such as the structure array for the DB, shall be declared as local variables in main() and passed to the other functions as needed. Validation of inputs is required. In particular: Customer and Account ID's shall be checked for length, converted to upper case, and not be case sensitive. Other data fields requiring alphabetical or numerical data should be checked for. Invalid input data shall be rejected. A database entry must be complete and validated before it is added to the database. The string class shall not be used for any data in the program. The user shall have a way to write a report file. The program shall be able to read and write text files that hold the customer portfolio database. Text file names shall end with the .dat extension. When it is first started, the program shall inquire if a database file already exists, and what its name is. Alternatively, the filename can be designated on the command line. If the file exists, it shall be opened for reading and writing. If not, a new file of that name shall be opened. Upon program exit, the database file shall be closed. Database File Format Here is the format for one record of the customer portfolio database file. Customer_ID Last_name, First_name, Middle_name Tax_D_number Phone number Acct_ID Acct_Balance Growth_Rate Comp_per_yr (repeated up to 5 times) Sample Database File The DB file shall have the format exhibited below, with customer portfolio records delimited by blank lines. The last, first, and middle names are comma-delimited, and spaces in names should be handled correctly. The Tax ID, and Phone number fields should be long enough to handle International as well as US formats. The following example customer portfolio database file contains 3 records. RS001 McAllister, Billie Joe, Dean 123-89-4321 +1 775-332-4581 WF0342 75000.00 4.85 12 SB1942 100000.00 3.5 12 BA0001 23988.88 7.5 12 VG003 van Gogh, Vincent, Willem 945123-88822 +31 20 570 5200 ART015 100.00 2.5 12 C123A James Jr., Jesse, Woodsen 323-77-2134 (816) 736-8500 252C42 126812.33 5.0 1 XXXC42 75000.00 4.5 12 JJ1847 34009.05 2.5 12 JJ1882 1004.03 12 CC1492 19754.00 3.55 4 0.5 Sample Customer Information Display Record No. : 1 Customer ID: RS001 Last Name : McAllister First Name: Billie Joe Middle Name : Dean Tax ID Num : 123-89-4321 Num. Accts : 3 Acct ID Balance rate C/Y Acct No. 1 : WF0342 Acct No. 2 : SB1942 Acct No. 3 : BA0001 75000.00 100000.00 23988.88 4.85 3.50 7.50 12 12 12 When the user chooses option 4) to display portfolio projections, the program shall prompt for a Customer ID, and for the number of years, and the screen shall show report style output. The report shall include the same information as the customer portfolio database, but it shall be formatted for human viewing, as a table. The #include file shall be used for this purpose. It shall also forecast account values for a designated number of years in the future, based on compound interest (default: 1 year). Sample Customer Report Display CustID Last_Name First_Name Middle TAX ID Phone RS001 McAllister Billie Joe Dean 123-89-4321 +1 775-332-4581 Accounts Balance % Rate C/Y Projections (1 yr) WF0342 SB1942 BA0001 75000.00 100000.00 23988.88 4.85 3.5 7.5 12 12 12 78719.46 103556.70 25851.20 Totals: 198988.88 208127.36

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

2. How will you handle the situation?

Answered: 1 week ago

Question

3. Write a policy statement to address these issues.

Answered: 1 week ago