Log into the computer science server and use
your starter code.
wget to download the file at http://cs.longwood.edu/courses/cmsc160/f17/files/lab4.tgz
- Uncompress the lab4.tgz file by using
tar -xvzf lab4.tgz
ls to see that there is a new directory called lab4
cd lab4 to change directory to the lab4 directory
We can create new files and directories but sometimes we need to move or delete our files.
rm filename permanently removes (deletes) the file
cp oldname newname copies the file at oldname to a new file at newname.
mv oldname newname moves the file from oldname to the file newname. Note this does not copy, can overwrite files and removes the original file!
Each of these commands has additional options, you can find out more about linux commands by reading the man pages found using the
program. Try out
to see all of the options.
Write the code for a program that prompts the user for two integer numbers and prints each number from the smaller number to the larger number.
You should also write code to find and print the GCD of the two numbers.
In this lab we will:
- write test cases
- write a README
- practice using conditions
Remember, you will be graded on style, syntax, functionality, test cases, and correctness.
An Example README.txt:
Lab3: Three Numbers
Author: Julian Dymacek
Date: 2017 Sept. 5
A program to compute statistics about three decimal numbers.
3 4 5
GCD is 1
You should start by creating test cases. What are possible tricky conditions that you should test? Next think about what data you will need to store. What kind of information do you need to output?
When you are done you may hand in your lab by using
The lab is due at 11:59pm Sept. 19th 2017.