Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.145.72.44
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/dobutler/../owpile/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/dobutler/../owpile/lab1.cpp
// p. 107 for Course
// p. 110 for date, stuType, reg
// p. 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, day, 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';

	// Q: myReg for student: Ally Thomas, 12/1/19992, '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';

	hisReg=myReg;
	cout << "Birth year: " <<hisReg.stu.birth.year << "\n\n";
	cout << "ByeBye.\n\n";

	return 0;
}



Stv3n404 - 2023