consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
#include <iostream>
#include <ctime>
using namespace std;
void menu() {
cout << "============================" << endl;
cout << "=========== MENU ===========" << endl;
cout << "============================" << endl;
cout << "1 ... GENERATE WATER INTAKES" << endl;
cout << "2 ... PRINT WATER INTAKES" << endl;
cout << "0 ... EXIT" << endl;
cout << "============================" << endl;
cout << "Select: ";
}
void fillArray(float* array, const unsigned int size) {
for (unsigned int i = 0; i < size; i++) {
array[i] = 0.5f + i * 0.3f;
}
}
void printArray(const float* array, const unsigned int size) {
for (unsigned int i = 0; i < size; i++) {
cout << ((i > 0) ? ", " : "") << array[i];
}
}
int main() {
const unsigned int days = 10;
float* waterIntakes = new float[days];
srand(time(nullptr));
bool running = true;
int selection;
do {
menu();
cin >> selection;
switch (selection) {
case 1:
fillArray(waterIntakes, days);
break;
case 2:
printArray(waterIntakes, days);
break;
case 0:
running = false;
break;
default:
cout << "Wrong selection!" << endl;
break;
}
cout << endl;
} while (running);
delete[] waterIntakes;
return 0;
}