-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserInput.h
38 lines (28 loc) · 904 Bytes
/
UserInput.h
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
// a. Michael Bertagna
// b. 2353491
// c. bertagna@chapman.edu
// d. CPSC 350-01
// e. Assignment 3
/* UserInput.h is a header file which lays out the elements of the UserInput class. */
#ifndef USERINPUT_H
#define USERINPUT_H
#include <iostream>
#include <ctype.h> //for isDigit()
#include <string> //for stod() and stoi()
using namespace std;
class UserInput{
public:
UserInput();//default constructor
~UserInput();//destructor
// gets height value from user and provides input protection
int getHeightNum();
// gets width value from user and provides input protection
int getWidthNum();
// gets density value from user and provides input protection
double getDensityNum();
// checks if string is an +integer
bool isPosInt(string maybeInt);
// checks if string is a +double in range (0,1]
bool isPosDouble0to1(string maybeDouble);
};
#endif