-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (35 loc) · 785 Bytes
/
main.cpp
File metadata and controls
40 lines (35 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "converters/types.h"
#include "converters/temperature.h"
#include <iostream>
#include <array>
ConversionType getConversionType()
{
int choice;
std::array<ConversionType, 2> conversionTypes = {
ConversionType::Temperature,
ConversionType::Distance};
while (true)
{
printf("Select type of conversion:\n");
printf("[1] Temperature\n");
printf("Enter choice: ");
scanf("%d", &choice);
if (choice > 0 && choice <= conversionTypes.size())
{
return conversionTypes[choice - 1];
}
printf("Invalid choice. Please try again.\n");
}
}
int main()
{
ConversionType type = getConversionType();
switch (type)
{
case ConversionType::Temperature:
{
TemperatureConversion::startFlow();
break;
}
}
}