We want to know to use Control-D to stop iteration. This is an exercise in using that universal code meaning “the end”.
Make a hybrid program that produces the following output. Additional details will be given later.
Welcome to Statistical Numbers
Bought to you by Snow Bird
We will compute the mean for you using only integers.
Enter a sequence of long integers separated by white space. After the last input press Control+D. 3 -12 9 21 -4 13 <cntl+D>
The number of numbers entered was 6.
The integer mean was 5.
Do you have more sets of integers to process (y or n)? y
We will computer the mean for you using only integers.
Enter a sequence of long integers separated by white space. After the last input press Control+D. 4 9 17 <cntl+D>
The number of numbers entered was 3.
The integer mean was 10.
Do you have more sets of integers to process (y or n)? n
Snow Bird hopes you liked your means. Please come again.
This software will return the last mean to the driver program. Bye
This is the C++ program responding. Here we received the number 10. Have a nice day.
The C++ program will not return a zero to the operating system.
The first module to execute has source code written in C++. The first to execute program is sometimes called the driver program.
The second module is written in X86. This program produces all the output inside the rectangle on the preceding page.
Obviously you change the name of the author in the example to be your own name.
Be sure to test your program with numbers greater than 4.5 billions and less than -4.5 billion. Those number with magnitudes greater than 4.5 B, which is to say greater than 232 sometimes produce mathematically wrong outputs.
Make a bash file that compiles and runs everything related to this program.
When you are done
You options are the following.
1. You may keep your program in your computer for future use, and tell nobody about it.
2. You may start your program in the classroom during the lab hour, get my attention, I will go to where you are, and I’ll watch you demonstrate your program. I will tell you my opinion of the quality of your program.
3. You may email to me the source files of your program. I will test your program on an Xubuntu 19.4 machine. I will email back to you an evaluation of your program along with a numeric score.
Don’t email me broken code. It is better to discuss fixing code during the lab portion of the class meeting.
Due: September 23, 2019
If you finish by the date given above then be assured that you are fully caught up with the progress of this class.