Description
Lab1 is a warmup to C++, with a focus on functional decomposition and IO
followed by, time permitting, a quick review of parameter passing.
At the end of lab, make sure that you have completed STEP #8
DO NOT worry if you do not complete all steps, but strive to complete steps 1-7.
2430 students have different backgrounds and will work at different paces
DO NOT USE the class construct.
Follow these steps:
1) Create a file called L1.cpp
2) Write the skeletal main routine, which should look something like:
#include
using namespace std;
int main()
{
cout << “Welcome message” << endl;
…
cout << endl << “End of Lab1 Pgm” << endl;
return 0;
}
3) Write the code needed to accept integer input from the keyboard until 10 EVEN numbers between 11 and 99 have been stored
4) Put the code from #3 in a function, call the function from main, with a parameter that determines how many EVEN numbers between 11 and 99 will be stored.
5) Write the code to output the stored numbers, also identifying the maximum value of the stored numbers.
6) Put the code from #5 in a function, determine where to place the function call
7) Accept input from the user so that many, different sequences of numbers, of different sizes can be stored and output
8) Upload your L1.cpp file to BOTH cs1 and Canvas
9) Time permitting, experiment with parameter passing. Start by outputting the value of variable alongside their address, as demonstrated below. Prof. Dingle will provide more detail in lab.
cout << x << &x << endl; // output x’s value and then address