/***************************************************************
* Name: Rafael Orta
* Course: Computer Science & Programming
* Class: CS04103
* Assignment Date: 10/04/18
* File Name: CSNP-Lecture5.cpp
*****************************************************************
* ID: Lecture 5
* Purpose: This program demonstrates concepts that are part of
* chapter 5.
*****************************************************************/
// ********************* For Loop *************************
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
/*
int main()
{
string Type = " ";
int Result = 0;
cout << " *************************************************************" << endl;
cout << " This Program identify and displays if a number is even or odd" << endl;
cout << " *************************************************************" << endl << endl << endl;
for (int Count = 0; Count <= 10; Count=Count+1){
Result = Count % 2;
if (Result == 0)
cout << Count << " Is an even number" << endl;
else
cout << Count << " Is an odd number" << endl;
}
return 0;
}
*/
// ********************* While Loop *********************************
/*
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
string Type = " ";
int Result = 0, Count = 0;
cout << " *************************************************************" << endl;
cout << " This Program identify and displays if a number is even or odd" << endl;
cout << " *************************************************************" << endl << endl << endl;
while (Count <= 10) {
Result = Count % 2;
if (Result == 0)
cout << Count << " Is an even number" << endl;
else
cout << Count << " Is an odd number" << endl;
Count ++;
}
return 0;
}
*/
// ****************** Do While Loop ******************************
/*
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
string Type = " ";
int Result = 0, Count = 0;
cout << " *************************************************************" << endl;
cout << " This Program identify and displays if a number is even or odd" << endl;
cout << " *************************************************************" << endl << endl << endl;
do {
Result = Count % 2;
if (Result == 0)
cout << Count << " Is an even number" << endl;
else
cout << Count << " Is an odd number" << endl;
Count ++;
} while (Count <= 10);
return 0;
}
*/
// ************************ Setw() ********************
/*
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;
int main()
{
int Square = 0 , Size = 0, Spaces=10;
string SquareS = " ";
for (int Count = 0; Count <= 20; Count++){
Square = pow(Count,2);
// SquareS = to_string(Square);
// Size = SquareS.length();;
// if (Size <= 2)
// cout << Count << setw(10) << right << Square << endl;
// else if (Size == 3)
// cout << Count << setw(9) << right << Square << endl;
cout << Count << " " << Square << endl;
}
return 0;
}
*/