Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#pragma once #include person.h #include #include #include #include using namespace std; ostream& operator < < ( ostream& os , const UserInfo& userInfo ) {

#pragma once
#include "person.h"
#include
#include
#include
#include
using namespace std;
ostream& operator<<(ostream& os, const UserInfo& userInfo){
os << "Username: "<< userInfo.getUsername()<< endl;
os << "Password: "<< userInfo.getPassword()<< endl;
return os;
}
istream& operator>>(istream& is, UserInfo& userInfo){
cout << "Enter username: ";
is >> userInfo.username;
cout << "Enter password: ";
is >> userInfo.password;
return is;
}
ostream& operator<<(ostream& os, const Person& person){
os << "Age: "<< person.age << endl;
os << "Name: "<< person.name << endl;
os << "Address: "<< person.address << endl;
os << "Email: "<< person.email << endl;
os << "Phone Number: "<< person.phoneNo << endl;
return os;
}
istream& operator>>(istream& is, Person& person){
cout << "Enter age: ";
is >> person.age;
cout << "Enter name: ";
is >> person.name;
cout << "Enter address: ";
is >> person.address;
cout << "Enter email: ";
is >> person.email;
cout << "Enter phone number: ";
is >> person.phoneNo;
return is;
}
void UserInfo :: setUsername()const
{
cin>>username;
}
string UserInfo :: getUsername()const
{
return username;
}
string UserInfo :: getPassword()const
{
cin>>password;
return password;
}
//ing person information
void Person:: getPersonData(){
cout<<"Enter age: ";
cin>>age;
cout<<"Enter phone number: ";
//cin.get();// very usefull while using getline multiple times
cin >> phoneNo;
cout<<"Enter name: ";
//cin.get();
cin >> name;
cout<<"Enter address: ";
//cin.get();
cin >> address;
cout<<"Enter email address: ";
cin>>email;
}
// displaying person information
void Person :: showPersonData(){
cout<<"Age: "<>"

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

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions