Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So I am trying to follow the directions here: I am very confused as to how to implement structures, templates, and modify vector elements from

So I am trying to follow the directions here:

image text in transcribed

I am very confused as to how to implement structures, templates, and modify vector elements from a structure.

My code so far is:

Main:

image text in transcribed

function_file.cpp :

image text in transcribed

Header file:

image text in transcribed

So long story short, how exactly do I get this set up so that I can begin getting user input into first name, last name, and balance? (Account number generated randomly)

Create a vector of the bank accounts. Each element of the vector will have all the account information. To do this, you would have to use data structure. The keyword struct in C++ will make a data structure. Inside the data structure, you will define all of the account information The following is an example: struct Account int accountNumber; string lastName; string firstName; double account Balance; vector KAccount bankAccounts; The code snippet above defines data structure type Account and a vector name bankAccounts of type Account. Each element of the vector will have member accountNumber, lastName, firstName, and accountBalance. The vector should be defined in the main0function. This means that as long as the program running (the bank is operating), we have the list of bank accounts. This should not be the global variable. The program should be running until terminated by the user. In order to update the information of bank accounts in the vector. you would have to pass by reference to the functions. Another option is pass by pointer. You can explore this option if desiree. Because the data in the vector is of the special type, you have to make a template for the typename. Template allows you to write functions independent of the data type being passed to the functions. The example of a prototype function as follow: template

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

sponsor any campus programs?

Answered: 1 week ago

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago