How do you do this?

Hi, I am a beginner in C++ and he has asked me to complete the question below. I do not know how to complete this program at all. I was wondering if you could help me with an example of some type and I am overwhelmed. I worked a solid day and have come up with nothing so far. Please can you help me?

Design a computer programming experiment in C++ to determine what happens when
a variable of type int is incremented above its range or decremented below its range. Repeat your experiment to determine what happens with a short int and long int. Next, modify your experiment to find out how unsigned variants of the integer types behave when their range is exceeded. Finally, try your experiment with a float and double.

Write up and submit a laboratory report of your experiment.
The report must be 3-5 pages including the cover page.
Your write up should have the following sections:
 -Cover page (name, class, assignment number, due date)
 -Introduction (research question and hypothesis)
 -Experimental methodology (how you answered the questions and source code)
 -Results (explain what happened and why)


...and there comes another homework, yet asked in a very cunning way.
Please provide code and what you actually need help with. Not "I don't know anything please do the assignment for me."
#include <iostream>
#include <limits>

using namespace std;

int main()
{

cout << "Minimum value for integer: "
<< numeric_limits<int>::min() << endl;
cout << "Decrementing the minimum value of integer below its range: ";
numeric_limits--;

cout << "Maximum value for integer: "
<< numeric_limits<int>::max() << endl;
cout << "Incrementing the maximum value of integer above its range: ";
numeric_limits++;

cout << endl;

cout << "Minimum value for short int: "
<< numeric_limits<short>::min() << endl;
cout << "Decrementing the minimum value of short int below its range: ";
numeric_limits--;

cout << "Maximum value for short int: "
<< numeric_limits<short>::max() << endl;
cout << "Incrementing the maximum value of short int above its range: ";
numeric_limits++;

cout << endl;

cout << "Minimum value for long int: "
<< numeric_limits<long>::min() << endl;
cout << "Decrementing the minimum value of long int below its range: ";
numeric_limits--;

cout << "Maximum value for long int: "
<< numeric_limits<long>::max() << endl;
cout << "Incrementing the maximum value of long int above its range: ";
numeric_limits++;

cout << endl;

cout << "Minimum value for unsigned int: "
<< numeric_limits<unsigned int>::min() << endl;
cout << "Decrementing the minimum value of unsigned int below its range: ";
numeric_limits--;

cout << "Maximum value for unsigned int: "
<< numeric_limits<unsigned int>::max() << endl;
cout << "Incrementing the maximum value of unsigned int above its range: ";
numeric_limits++;

cout << endl;

cout << "Minimum value for float: "
<< numeric_limits<float>::min() << endl;
cout << "Decrementing the minimum value of float below its range: ";
numeric_limits--;

cout << "Maximum value for float: "
<< numeric_limits<float>::max() << endl;
cout << "Incrementing the maximum value of float above its range: ";
numeric_limits++;

cout << endl;

cout << "Minimum value for double: "
<< numeric_limits<double>::min() << endl;
cout << "Decrementing the minimum value of double below its range: ";
numeric_limits--;

cout << "Maximum value for double: "
<< numeric_limits<double>::max() << endl;
cout << "Incrementing the maximum value of double above its range: ";
numeric_limits--;

cout << endl;

return 0;
}
Topic archived. No new replies allowed.