COMS W3101-2
Homework 1: Basic I/O
Worth: 20% of total homework grade.
Goals:
The main goals of the first homework are to (1) learn basic I/O and (2) get you successfully developing and submitting programs while using the CUNIX cluster.
While you may develop your software on whatever system/compiler you like, you will receive no credit if your programs do not successfully compile and run on CUNIX.
More information about using CUNIX to develop and compile software can be found in the "How To" section.
Assignment:
-
hw1a.cc
(25%)
Write a program that prints out the words:
Hello, world!
-
hw1b.cc
(25%)
Write a program that engages in the following dialogue:
- Please tell me your name:
- waits for your response (here indicated as input)
- responds Hello input!
-
hw1c.cc
(25%)
Write a program that will ask you for a weight in kilograms and then convert it to pounds for you (the conversion ratio is 2.2 pounds per kilogram).
Hint: instead of using int try using double
-
hw1d.cc
(25%)
Write a general case conversion program that first asks you for a conversion ratio and then does a conversion for you.
sample output:
$What conversion ratio would you like to use?
$0.9144
$Please enter the amount you'd like converted
$25
$the converted amount is 22.86
Files to be submitted:
- hw1a.cc
- hw1b.cc
- hw1c.cc
- hw1d.cc
- typescript
- REAMDE
Remember, all source code files should be clearly commented.
Code should be clean and easily readable.
Errors should be checked or handled according to your current knowledge-base.
If your files are not named according the above conventions, they will not be graded and you will receieve NO CREDIT.
For README and typescript requirements, look in the "How To" section.
How To:
Make your submission
Write a README
Make a typescript
Use CUNIX
Joshua Reich reich@cs.columbia.edu
Last Modified: March 20, 2006