Professional Documents
Culture Documents
Exercise#1
#include <stdio.h>
int main() {
// Declare a variable of type Date
struct Date dob;
// Input student ID
cout << "- Student ID: ";
cin >> newStudent.id;
return newStudent;
}
int main() {
// Initialize student information
Student s1 = {123, {2000, 1, 1}, {2026, 2, 28}};
cout << "\nInput the new student information: " << endl;
s1 = getStudentInfo();
return 0;
}
Exercise#3
#include <iostream>
#include <cmath>
using namespace std;
int main() {
// Define points
Point p1 = {0, 0}, p2 = {9.5, 9.5};
// Define a circle
Circle c1 = {{2.5, 2.5}, 4.5};
if (isInside(c1, p2)) {
cout << "Point p2 is located inside or on the boundary of the circle." << endl;
} else {
cout << "Point p2 is outside the circle." << endl;
}
return 0;
}