C++ Please Write a program that utilizes a struct data structure and a vector of that structure type. 1. Create an Account struct that includes the following data members: string fName (first name), string IName (last name), string email. 2. Create a vector of type Account called "Accounts". [vectorvectorName] 3. Create two Accounts acct1 and acct2. Use user-input the get data for the accounts. 4. Add both Accounts to the accounts vector. 5. Use a loop to print every Account in the vector. Struct_Practice.cpp #include #include #include using namespace std; int main(){ struct Account{ string fName; /* ADD CODE HERE */ } Account acct1; Account acct2; vector accounts; /* ADD CODE HERE */ count << endl; // bank line for (int i=0 ; i< accounts.size();++i){ /* ADD CODE HERE */ } }// end main()
C++ Please
Write a program that utilizes a struct data structure and a
1. Create an Account struct that includes the following data members: string fName (first name), string IName (last name), string email.
2. Create a vector of type Account called "Accounts". [vector<VectorDataType>vectorName]
3. Create two Accounts acct1 and acct2. Use user-input the get data for the accounts.
4. Add both Accounts to the accounts vector.
5. Use a loop to print every Account in the vector.
Struct_Practice.cpp
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
struct Account{
string fName;
/* ADD CODE HERE */
}
Account acct1;
Account acct2;
vector<Account> accounts;
/* ADD CODE HERE */
count << endl; // bank line
for (int i=0 ; i< accounts.size();++i){
/* ADD CODE HERE */
}
}// end main()
Step by step
Solved in 5 steps with 3 images