/*-------
Signature: main: void -> int
Purpose: to play with cin a bit --
will ask the user to enter int, double, char,
string, and bool values,
and then display each of these to the screen
Examples: if, when this is run, when prompted, the user types:
3
1.4
a
dachshund
true
...then this should print to the screen:
int read was: 3
double read was: 1.4
char read was: a
string read was: dachshund
bool read was: true
if, when this is run, when prompted, the user types:
7
4.1
y
weiner-dog
false
...then this should print to the screen:
int read was: 7
double read was: 4.1
char read was: y
string read was: weiner-dog
bool read was: false
by: Sharon Tuttle
last modified: 2016-11-04
--------*/
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
cout << boolalpha;
int an_int;
double a_double;
char a_char;
string a_string;
bool a_bool;
// ask the user to enter an int, double, char, string,
// and bool
cout << "Type an int, a double, a char, a string, and "
<< "a bool, TYPING ENTER after each: " << endl;
// read in what they type
cin >> boolalpha >> an_int >> a_double >> a_char
>> a_string >> a_bool;
// print to the screen what cin read in
cout << "int read was: " << an_int << endl
<< "double read was: " << a_double << endl
<< "char read was: " << a_char << endl
<< "string read was: " << a_string << endl
<< "bool read was: " << a_bool
<< endl;
return EXIT_SUCCESS;
}