CS 107 - 6/17/15 Items from the Lab. 1. Help on a Linux system http://accc.uic.edu/service/shell-accounts/basic-unix man command 2. File listings on a LINUX ls la -a show all files ls -l show attribute information on the files 3. Editing vi and nano editors 4. Compilation in C/C++ g++ file.cpp Translate the C/C++ source code contained in the file file.cpp into the machine code in the file a.out Program development includes 1. Editing the program ( nano file.cpp ) 2. Compiling the program ( g++ file.cpp ) 3. Run/executing the program (./a.out ) 4. Repeat as needed 5. To run/execute the program, the computer needs to run the machine code ./a.out ./ look in the current directory 6. Mail the program to yourself mail -a file.cpp troy@uic.edu Starting Point for Lab Exercise 1 >>>>> Comments - Header Block Comment >>>>> Start /* End */ >>>>> Compiler ignores any comments >>>>> Comments - End of Line Comments >>>>> Start // /* Lab Assignment 1 for CS 107 - Summer 2015 * * Written by Pat Troy - 6/16/15 * * This program is to print some information regarding the St. Ives rhyme * Complete information on the requirements of this assignment can be * found at: https://www.cs.uic.edu/bin/view/CS107/Lab1sum15 */ >>>>>> Library inclusion statement >>>>>> states we are using standard C++ input/output #include >>>>>> Each library gets put in its own "namespace" >>>>>> Undefined elements will be assumed to be part of >>>>>> the "using namespace" using namespace std; >>>>>> start of our main function int main() { >>>>> Output line // Print information about the author cout << "Author: Pat Troy" << endl; cout << "UIN: 123456789" << endl; cout << "CS 107 - Summer 2015" << endl; cout << "Lab Assignment 1" << endl; cout << "Lab Time: Wednesday at 10am" << endl; // set up the variables for the St. Ives Rhyme int numMan; int numWives; // calculate the vaules for each variable numMan = 1; numWives = numMan * 7; // Print out the information for the St. Ives cout << endl; cout << "Print the St. Ives Rhyme information" << endl; cout << " The number of men met are: " << numMan << endl; cout << " The number of wives met are: " << numWives << endl; // end the program execution return 0; }