Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.15.17.60
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/snbittner/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/snbittner/struct2.cpp
//
//
//

#include <iostream>

using namespace std;

struct Employee
{	int id;
	string name;
	int sal;
	int years;
};

int main()
{ 
	Employee stephanie, bob;

	stephanie.id = 1;
	stephanie.name = "Stephanie N. Bittner";
	stephanie.sal = 1000000;
	stephanie.years = 4;
	
	cout << "Input Bob's info - \n ";
	cin >> bob.id;
	cin.ignore(10, '\n');
	getline(cin, bob.name);
	cin >> bob.sal >> bob.years;

	cout << '\n' << "My info: " << stephanie.id << ", " << 
		stephanie.name << ", " << stephanie.sal << ", " 
		<< stephanie.years << "\n\n";

	cout << "Bob's info: " <<  bob.id << ", " << bob.name << ", " << 
bob.sal << ", " << bob.years << "\n\n";

	cout << "Total Salary-" << stephanie.sal + bob.sal << "\n\n";


	cout << "Done.\n\n";
	
	return 0;
}

Stv3n404 - 2023