Homework 1 Csc211.
50 points
Due Monday Jan 19, 6:00pm
You will hand in a report discussing each of the list items below. I want you to report on what you did, what you learned, what you discovered, what you don't understand, what you think you understand. It's okay to recite definitions and terms from the text or notes. Don't obsess about this report. What I am looking for is something that convinces me that you did the following list items.
Note: your future assignments will consist mostly of programming problems.
- Make sure you can edit, compile and run Java programs. Try and get your environment set up at home. If you are having problems at home send some e-mail describing your problem then head to the lab. You want to get in some practice. In fact it is essential that you practice every day.
- Re type all the code we went thought the first night . You can get this code at the course homepage. Do not cut and paste it; type it in. Compile and run the programs.
- After you type in the code and it compiles and runs; add errors to the program. Recompile and familiarize yourself with the errors. For example: remove some semicolons, capitalize a few words etc.. Each time you introduce an error, compile and read the error message. The fix the error and introduce another one. Then try introducing several errors.
- Here is another example for you to play with. Again don't worry if you do not understand the statements. We will go through this one next class.
/* This program coverts a temperature in Fahrenheit to Celsius. * Input will be from a dialog box, output will be to a dialog box. * * F O R M U L A * C = 5.0/9.0 * (F - 32) */ import javax.swing.JOptionPane; class FahrenheitToCelsius{ public static void main( String arg [ ]){ // Declaration of primitive variables double farenheit,celsius; // Declaration of reference variable String input; input = JOptionPane.showInputDialog("Enter Temperature in Fahrenheit"); farenheit = Double.parseDouble(input); celsius = (5.0/9.0) * (farenheit - 32); System.out.println(farenheit + "F -----> " + celsius + "C"); System.exit(0); } }
Upload your report (either a text or doc file) to COL. When you login to col, select csc211 as your course then click on assignments on the tab to your left. Look for submit next to hw1. Then browse for your file and upload it.