0% found this document useful (0 votes)
6 views2 pages

Main CPP

Uploaded by

vqrprnqr6x
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Main CPP

Uploaded by

vqrprnqr6x
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <iostream>

#include <string>

using namespace std;

int main() {
// Basic Information
string name = "Alex"; // Replace with your name
int age = 21; // Replace with your age
int studyHours = 4; // Number of hours planned for study
int exerciseHours = 1; // Number of hours planned for exercise
int relaxHours = 2; // Number of hours planned for relaxation

// Display Basic Information


cout << "Daily Routine for " << name << endl;
cout << "Age: " << age << endl << endl;

// Age Group Categorization using Switch Statement


cout << "Age Group: ";
switch (age / 10) {
case 0:
case 1:
cout << "Child" << endl;
break;
case 2:
cout << "Young Adult" << endl;
break;
case 3:
case 4:
cout << "Adult" << endl;
break;
default:
cout << "Senior" << endl;
break;
}

// Routine Details
cout << "\n--- Daily Routine ---" << endl;
cout << "7:00 AM - Wake up" << endl;
cout << "8:00 AM - Start studying (" << studyHours << " hours)" << endl;
cout << "12:00 PM - Take a break and have lunch" << endl;
cout << "1:00 PM - Exercise (" << exerciseHours << " hour)" << endl;
cout << "2:00 PM - Relax or pursue a hobby (" << relaxHours << " hours)" <<
endl;
cout << "10:00 PM - Prepare for bed" << endl;

// Routine Balance Check


cout << "\n--- Routine Balance Check ---" << endl;

// Criteria for a balanced routine


bool balanced = true;
if (studyHours < 3) {
cout << "- Consider increasing study time to at least 3 hours." << endl;
balanced = false;
}
if (exerciseHours < 1) {
cout << "- Consider increasing exercise time to at least 1 hour." << endl;
balanced = false;
}
if (relaxHours < 1) {
cout << "- Consider relaxing or pursuing a hobby for at least 1 hour." <<
endl;
balanced = false;
}

if (balanced) {
cout << "This is a well-balanced routine!" << endl;
} else {
cout << "Adjustments needed to balance your routine." << endl;
}

return 0;
}

You might also like