CGS3767 Homework 1
Due Monday 1/28 (late: 1/29 at 6am).
Review the Java example from class that calculated the number of coins in a number of cents. You will be creating scripts that do the same thing.
- Calculate the number of quarters that are in the amount of cents and calculate the remaining number of cents.
- Calculate the number of dimes in the remaining cents and recalculate the remaining cents.
- Calculate the number of nickels in the remaining cents and recalculate the remaining cents.
- Calculate the number of pennies in the remaining cents.
- Display the number of coins. Use complete sentences to explain the output. Do not print output for a coin if the number of coins is zero.
- If the orignal number of cents is 0, it is not an error, but print an appropriate message.
- If the original number of cents is negative, it is an error. Print an appropriate message.
Fedora
You will install a version of Fedora in a virtual machine in the lab. You will create a bash script. You do not need to create the script in your virtual machine. You may create and run the scripts on any Linux machine.
- Install Fedora 16 in a virtual machine in the lab.
Fedora Virtual Machine Tutorial
- Create a bash script using the nano editor on Linux. Do not use a Windows editor in the lab to create a bash script. Bad things can happen.
- The script should implement the change program.
- The script should read the number of cents to process from the command line arguments.
- Create a thorough test script. Redirect the output to a text file.
- View video on creating, running and testing a bash script file.
Windows
You will install a version of Windows in a virtual machine in the lab. You will create a DOS script. You do not need to create the script in your virtual machine. You may create and run the scripts on any DOS machine.
- Install Windows in a virtual machine in the lab.
Windows Virtual Machine Video
- Create a DOS script using the Notepad editor on Windows. Do not use a word processor to create a Windows script. Bad things can happen.
- The script should implement the change program.
- The script should read the number of cents to process from the command line arguments.
- Create a thorough test script. Redirect the output to a text file.
- View video on creating, running and testing a batch file.
Uploading
Create two zip files as follows.
-
Create a zip file containing the bash script, its test script and the output of the test script. Include the word bash somewhere in the name of the zip file.
-
Create a zip file containing the DOS script, its test script and the output of the test script. Include the word DOS somewhere in the name of the zip file.
Upload the zip files on the class web site. Upload them one at a time.
Upload HW
- Upload each file as binary.
- Select your operating system.
- Select the course, section and assignment.
- Browse for the file that you are submitting.
Verify that the size of the upload is correct.
- Find the file that you uploaded using Windows Explorer.
- Right-click the file and open the Properties.
- Read the size of the actual file and compare it with the size that the upload page shows.