Assignment #1

CS 163 Data Structures

 

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

***Assignments in CS163 consists of written homework and programming***

The written portion MUST be turned in to get a grade on an assignment

 

LATE work will be accepted – but ONLY within a week of the original due date.

We do not accept late work beyond that. There are no exceptions.

 

1.      Create an Algorithm for the process of how to be successful with this course. Think about what you will need to do this term, in a step by step fashion, to learn the most. Think about when and how you will watch (or attend) lectures. How you plan to work on the weekly labs and readings. Think about how confident you feel about classes, pointers, linear linked lists and recursion and what you will need to do for review of these topics.

 

Algorithms should be written using complete sentences in a way that is easy to follow – consider using outline form. Think of (a) what you will need to do (read the syllabus…etc.) (b) when you need to do each of these, and then (c) think about how best you learn and what you will need to do to take what is discussed or taught and be able to apply it.

 

2.      Ethics. In Computer Science we are responsible for the software that may have a much larger impact on people lives than we imagine. Over the last few months there have been many major web site revisions (my bank for example). The user interface is improved, but now it takes so long to load and I can’t get access to transactions earlier than 90 days. Now without printed statements, I have no access without ordering statements to review past history with no notification. Is this ethical? Have you experienced changes online that  don’t seem right? At what point are changes not ethical? Write 5 complete sentences with your thoughts about these ethical concerns.

 

3.      Experiencing Unix. In CS162, you should have experienced unix. Most students use pico or nano to create their programs. But, as we progress with unix, we need to experience more comprehensive editors. For this homework, read the “man” (manual) page for vim (type:  man  vim). Write about 2 of the features that you have learned about.

 

 

4.         Programming Project

 

Scope: When beginning with this project, the first thing to keep in mind is that we only have approximately 2 weeks to complete each assignment. Therefore, it is critical that you focus on a limited scope. You will be primarily graded on your use of classes, member functions, arguments, data structures, pointers and the efficiency of your code. You will need a main, but it should focus on testing out your class member functions rather than be the application program. Imagine that there is another software engineer who will be building the actual application software. Your job is to build the Abstract Data Type (ADT) and test it! You are not building the complete application.

 

Therefore, focus on how to design classes that are well structured and efficient and on the required data structures. Limit the development of the application that uses the data structures. Of course, your user interface must be clear enough for us to test your program and we must be able to thoroughly test all features. This first program of the term is an exercise in building, traversing, and destroying linear linked lists.

 

Background Information: Over the break, my family and I spent considerable time using computers and technology. My husband spent his time trying to migrate over to Windows 8. My daughter battled with the green screen of death with the Xbox One. And, I sat at my computer which sounds like the hair dryer is running all day long! As I ponder our predicament, I can only imagine that others are having similar issues with their technology.

 

Programming Assignment: With program #1, you will be creating a program that will simulate a multi-author blog that is organized by topic (so one thread on Xbox One versus another on rating laptops, etc.).  Blogs will consist of posts (comments) from users and a rating of how useful the comment is. Anyone should be able to rate a comment. Each thread should be stored as a linear linked list.  The, create a linear linked list of the topics, including a head pointer to that topic’s thread.

 

 

 

 

 

Here is a sample class interface that meets these requirements:

 

class Blog

{

      public:

            Blog();

             ~Blog ();

           //consider adding a keyword as well to a post…

            int Post(char topic[], char comment[]);  //add a post to a topic

            int Display(char topic[]);                          //display a particular thread

            int Display();                                              //display all threads

            int Rate(char topic[], char keyword[], int rating); //rate a comment

            int Remove(char topic[], char keyword[]); //remove a comment

      private:

              node * thread_list;      //this is for the LLL of topics

}; 

 

Things you should know...as part of your program:

1)      Do not use statically allocated arrays in your classes or structures. All memory must be dynamically allocated and kept to a minimum!

2)      All data members in a class must be private

3)      Never perform input operations from your class in CS163

4)      Global variables are not allowed in CS163

5)   Do not use the String class! (use arrays of characters instead!)

6)   Use modular design, separating the .h files from the .cpp files. Remember, .h files should contain the class header and any necessary prototypes. The .cpp files should contain function definitions. You must have at least 1 .h file and 2 .cpp files. Never implement functions in your .h file! And, never "#include" .cpp files!

7)  Use the iostream library for all I/O; do not use stdio.h.

8) Make sure to define a constructor and destructor for your class. Your destructor must deallocate all dynamically allocated memory.

9) Remember that 20% of each program's grade is based on a written discussion of the design. Take a look at the style sheet which gives instruction on the topics that your write-up needs to cover.