Tina Comston
Comp-111
Week 1
Franklin
University |
|
Week 1 |
|
|
Preparation
|
|
|
Guided
Learning Activity
- It
is tempting to bypass the Guided Learning Activities because there are
no points associated them, however, I urge you not to do so.
The
Learning Activities for each week have been developed to reinforce the
reading and provide an introduction to what you will be doing for the
homework.
- Instructions
for Week 1
- Solutions
for Week 1
|
|
|
Homework 1
All
homework is submitted through the course drop box. When you are
asked to write code for a homework problem, you will write your code in
BlueJ, compile and execute to ensure it correctly solves the problem.
Then copy your completed code and paste it into your homework word
document. The word document is then submitted to the drop box.
YouTube video on using BlueJ https://www.youtube.com/watch?v=BeNWOaWueYY
This
is a video produced by an instructor at another university. The
references to lab 1, working the lab with a partner, etc. are not valid
for our course, but the description of BlueJ and how it can be used to
create/compile classes is relevant and provides a good overview of the
software.
- Problem 1
- Programmers encounter 2 types of errors when writing programs
- For this first problem, you are to:
- Provide a definition of each type of error
- Identify how a programmer would discover that they have this type of error
- Problem 2
- Four pieces of code are provided, each containing an error. You are to:
- Create a class in BlueJ with the name ErrorIdentification.
- When
the class is created, BlueJ will insert some default code into the
class. Delete everything that BlueJ inserted so that you have an
empty class.
- Copy the code from the problem and paste it into the empty class.
- Compile the code and if possible execute the code.
- What type of error was contained in the code, syntax or logic?
- Problem 3
- "Draw" a house using the keyboard characters.
- Create a class in BlueJ with the name House.
- Delete everything that BlueJ inserted into the class so that you have an empty class.
- Copy the code from the problem and paste it into the class.
- Notice the comment line:
- // insert your statements here
- This is where you will insert your lines of code to "draw" your House.
- You
will use the System.out.println(); method to display your house to the
console. For this method, you will put what you want displayed
inside the parenthesis enclosed in double quotations. For
example:
- System.out.println("-------^----^--------");
- Perhaps the above statement would be part of your roof.
- You will want to both compile and execute your code to ensure that your code does not contain any syntax or logic errors.
- You
will also want to be careful when using the \ character. This is
an escape character signaling a special code to the computer. For
example \r\n signals a carriage return line feed (or advance to the
next line.)
- Problem 4
- You will take your completed code from above and insert comments into the code.
|
|
|
Reflection Paper
- This is a paper that you will be working on throughout the course.
This will be a journal of your experiences in the course.
Each week make note of any frustrations, successes, revelations,
etc. These can then be included in your final draft of this paper.
|