_zone-de-frappe
#include <string>
#include <vector>
#include <ctime>
class ConUHacksDinnerReminder {
private:
std::vector<std::string> Options;
std::string Restaurant;
public:
ConUHacksDinnerReminder(){
Options = {"Cheese", "Pepperoni", "Chicken", "Vegetarian"};
Restaurant = "Dominos's Pizza";
}
void ShowMenu(){
std::cout << "Available Options:" << std::endl;
for (int i = 0; i < Options.size(); i++) {
std::cout << i + 1 << "-" << Options[i] << std::endl;
}
int choice;
std::cout << "Pick your favorite flavor: ";
std::cin >> choice;
if (choice >= 1 && choice <= Options.size()) {
std::cout << "You chose: " << Options[choice - 1] << std::endl;
}else {
std::cout << "Invalid choice." << std::endl;
}
}
void CheckTime(){
time_t now = time(nullptr);
tm* localTime = localtime(&now);
int hour = localTime->tm_hour;
int minutes = localTime->tm_min;
std::cout << "Current time: " << hour << ":" << (minutes < 10 ? "0" : "") << minutes << std::endl;
if (hour == 19) {
std::cout << "Dinner time!!" << std::endl;
std::cout << "Dinner is from " << Restaurant << std::endl;
ShowMenu();
} else {
std::cout << "Keep hacking! Dinner is at 7:00 PM." << std::endl;
}
}
};
int main() {
std::cout << " Welcome to Hackathon's Typing Pal Speed Challenge! " << std::endl;
ConUHacksDinnerReminder reminder;
reminder.CheckTime();
return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <ctime>
class ConUHacksDinnerReminder {
private:
std::vector<std::string> Options;
std::string Restaurant;
public:
ConUHacksDinnerReminder(){
Options = {"Cheese", "Pepperoni", "Chicken", "Vegetarian"};
Restaurant = "Dominos's Pizza";
}
void ShowMenu(){
std::cout << "Available Options:" << std::endl;
for (int i = 0; i < Options.size(); i++) {
std::cout << i + 1 << "-" << Options[i] << std::endl;
}
int choice;
std::cout << "Pick your favorite flavor: ";
std::cin >> choice;
if (choice >= 1 && choice <= Options.size()) {
std::cout << "You chose: " << Options[choice - 1] << std::endl;
}else {
std::cout << "Invalid choice." << std::endl;
}
}
void CheckTime(){
time_t now = time(nullptr);
tm* localTime = localtime(&now);
int hour = localTime->tm_hour;
int minutes = localTime->tm_min;
std::cout << "Current time: " << hour << ":" << (minutes < 10 ? "0" : "") << minutes << std::endl;
if (hour == 19) {
std::cout << "Dinner time!!" << std::endl;
std::cout << "Dinner is from " << Restaurant << std::endl;
ShowMenu();
} else {
std::cout << "Keep hacking! Dinner is at 7:00 PM." << std::endl;
}
}
};
int main() {
std::cout << " Welcome to Hackathon's Typing Pal Speed Challenge! " << std::endl;
ConUHacksDinnerReminder reminder;
reminder.CheckTime();
return 0;
}
Accuracy
Mistakes
Speed
Not bad, but you know you can do better...
Try Typing Pal Now!