CS
1401 Introduction to Computer Science
Fall 2014, Lab 1
Welcome. Dear Friends, once again, welcome to computer
science. This is your first CS lab assignment. Do not
worry: your TAs will explain everything you need, they will do
everything for you -- short of writing the program for you, this
you have to do on your own. TAs will give you examples of similar
programs, you can find many examples of similar problems in the
book, and if you still have trouble, do not hesitate to contact
any of us. We all, instructor and TAs, are here to help you.
What your first program shall do. The program shall ask a
student user for the number of hours per week that he or she
studied, on average, for previous classes, then add 2 to it double and
print it as the number of hours that you need to study for Computer
Science classes. For example, if a student studied 4 hours every
week, the program should return 6.
In your program, you should:
- declare an integer variable
describing number of hours;
- read the value into this variable
(the TA will explain how to do it, the book also has many
examples);
- assign, to this variable, the original value
plus 2; and
- print the result.
Objectives. The main objective of this assignment is simply
to give you a hands-on experience with Java (and to scare you into
studying more :-).
When it is due. The program is due at the beginning of the
first lab section on the week of September 8, i.e.:
- on
Monday September 8 for those who attend Monday-Wednesday labs, and
- on Tuesday September 9 for those who attend Tuesday-Thursday
labs.
How to submit: Your TAs will instruct you how to submit the
programs.
Good luck!