-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathValidator.cpp
42 lines (31 loc) · 1.43 KB
/
Validator.cpp
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
41
42
// MIT License
// Copyright (c) 2025 Abiza Chiheb
// See the LICENSE file for full details.
#include <iostream>
#include "Validator.h"
int main()
{
cout << clsInputValidate::IsNumberBetween(5, 1, 10) << endl;
cout << clsInputValidate::IsNumberBetween(5.5, 1.3, 10.8) << endl;
cout << clsInputValidate::IsDateBetween(clsDate(),
clsDate(8,12,2022),
clsDate(31, 12, 2022)) << endl;
cout << clsInputValidate::IsDateBetween(clsDate(),
clsDate(31, 12, 2022),
clsDate(8, 12, 2022)) << endl;
cout << "\nPlease Enter a Number:\n";
int x= clsInputValidate::ReadIntNumber("Invalid Number, Enter again:\n");
cout << "x=" << x;
cout << "\nPlease Enter a Number between 1 and 5:\n";
int y = clsInputValidate::ReadIntNumberBetween(1,5,"Number is not within range, enter again:\n");
cout << "y=" << y;
cout << "\nPlease Enter a Double Number:\n";
double a = clsInputValidate::ReadDblNumber("Invalid Number, Enter again:\n");
cout << "a=" << a;
cout << "\nPlease Enter a Double Number between 1 and 5:\n";
double b = clsInputValidate::ReadDblNumberBetween(1, 5, "Number is not within range, enter again:\n");
cout << "b=" << b;
cout << endl << clsInputValidate::IsValideDate(clsDate(35,12,2022)) << endl;
system("pause");
return 0;
}