Answer to Question #247273 in C++ for nors

Question #247273

Display the following Employee information using the variables.


Name

Age

Gender

Address

Contact No.

Email

Monthly Salary


1
Expert's answer
2021-10-06T04:04:10-0400
#include <iostream>

using namespace std;

typedef struct{
    string name;
    int age;
    string gender;
    string address;
    string contactNo;
    string email;
    double monthlySalary;
}Employee;

void printEmployee(Employee e) {
    cout << "Name      : "<< e.name << endl;
    cout << "Age       : "<< e.age << endl;
    cout << "Gender    : "<< e.gender << endl;
    cout << "Address   : "<< e.address << endl;
    cout << "Contact No: " << e.contactNo << endl;
    cout << "Email     : "<< e.email << endl;
    cout << "Monthly Salary : $"<< e.monthlySalary << endl << endl;
}


int main()
{
    Employee e1 = { "John Silver", 40, "male", "Springfield Quay, Glasgow G5 8NP, GB", "+441412769599", "silver@org.uk", 5000.00 };
    Employee e2 = { "Otto von Bismarck", 50, "male", "Albrechtstrasse, 20, 10117 Berlin, Germany", "+493027907300", "bis@allhotels-inn.com", 3950.00 };
    Employee e3 = { "Marie-Antoinette", 21, "female ", "Rue de Rivoli, 75001 Paris, France", "+33140205050", "mary@louvre.fr", 4122.00 };
    Employee e4 = { "Nikolai Romanov", 35, "male", "2 Dvortsovaya pl., St. Petersburg, 190000, Russia", "+78127109079", "nik@mail.ru", 4000.00 };
    
    printEmployee(e1);
    printEmployee(e2);
    printEmployee(e3);
    printEmployee(e4);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS