Homework Assignment #1

 

CS 161: Introduction to Computer Science 1

 

 

Submit your assignment to the D2L Dropbox (sign on via www.my.pdx.edu)

or Email your answers to: karlafgr@cs.pdx.edu

 

 

***Homework in CS161 consists of written homework and programming***

 

1.      Create an Algorithm of your favorite MP3 player (e.g., ipod, etc.). Write the algorithm in an outline form using complete sentences. Think of (a) how do you turn it on, (b) how do you select a song to play, (c) how do you stop, etc.

·        Assume you are writing the algorithm for someone who has never used an MP3 player before

·        Be careful not to skip any steps

·        Desk check your algorithm (go through the algorithm as if you didn’t know how to music and see if you can follow these instructions!)

 

2.      Think about Style (i.e., how readable and/or maintainable a program is). Examine the demonstration programs that have been placed on our web site. Find 3 things that make the programs understandable or readable and list these in 3 complete sentences.

·        Although we don’t yet know how to write code that is shown in the demonstration software, I want you to examine the style presented in these programs. If they weren’t written in this manner, what would have the programs looked like – would they have been readable then??

·         So, you are looking for things that make the programs particularly easy to read.

 

3.      Ethics. In Computer Science we are many times placed in positions of having access to sensitive or private information. We also develop programs that work with this information and that must keep that data private and secure. In addition, in Computer Science we develop programs that are expected to create accurate output (for example, banking software can’t be off by a penny, or more!). Brainstorm on what you think 3 important ethical responsibilities are when dealing with computers. List these in 3 complete sentences, explaining why you believe these are important.

 

4.      Programming. Part of our first homework is to have logged on, entered, compiled, and executed a simple C++ program. This can be either on Unix or on your own computer with a compiler (e.g., Dev-C++ on a PC or others).

·        You are allowed to use the demo programs provided on our web site. If you do, make some unique modification that makes them your own. You can keep it simple.

·        It can be as simple as displaying your name on the screen!