Programming Assignment 4 - Introduction to Computer Science | CS 110, Assignments of Computer Science

Material Type: Assignment; Professor: Adjeroh; Class: Introduction-Computer Science; Subject: Computer Science; University: West Virginia University; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-ebm
koofers-user-ebm 🇺🇸

5

(1)

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
LCSEE, WVU
CS 110: INTRODUCTION TO COMPUTER SCIENCE, FALL 2008
PROGRAMMING ASSIGNMENT 4
ANNOUNCED : NOV. 22, 2008
DUE : DEC. 7, 2008, 11:59PM (PROGRAM CODES & DOCUMENTATION SUBMIT COMMAND)
MAX. MARK : 100
Question 1 (Sorting and Searching with Strings) 20 marks
(A) Chapter 10, Programming Exercise #8, pp. 692
(B) Chapter 10, Programming Exercise #9, pp. 692
(Note: that the bubble sort program for integers is already in our notes)
Question 2 (Binary Search with and without Recursion) 35 marks
(A) Chapter 10, Programming Exercise #13, pp. 962.
(B) Repeat (A), but by using a recursive version of the binary search method.
For Part (A), use a user-defined method called binarySearchVectors( ) to perform
the binary search. For Part (B), use a recursive version recursiveBinarySearch().
Notes: The book already has a binary search method for arrays in Chapter 10.
For this problem, you should use the bubble sort results developed
in part (Q1B) above (and not selection sort as suggested in the book).
Question 3 (Koch’s Snowflakes) 35 marks
Chapter 14, Programming Exercise #15, pp. 956
Note: This is a simple program, although it may look intimidating at first sight. For this
problem, first look at the example on pp. 944 of the book (also in the class handout). You
will need the drawLine() method, defined in java.awt.* and GUI components in
javax.swing.*. This problem covers materials from Chapters 13 and 14.
Programming Style & Program Organization 10 marks
Further Information
Remember that coding (or implementation) is just one aspect of the problem solving methodology. Projects will be marked
based on how well they follow the software development methodology as described in class. Also, see other examples in
the book. You could copy the problem as described in the book as your Problem Statement. The Problem Solving phase
is mandatory for all the questions. For details on the format for assignment submission, and guidelines for preparing your
projects, please see the documents:
“CS 110: Preparation and Grading of Programming Projects: The Importance of Professionalism”
http://www.csee.wvu.edu/~adjeroh/classes/cs110/general/proj-prep.htm, and
“CS 110: Format of Your Programming Projects”
http://www.csee.wvu.edu/~adjeroh/classes/cs110/general/prformat.htm
These documents are available from the course web site.
Also, see examples in the book (especially the Programming Examples).
Submit Command
Please submit all files used in your assignment using the submit command:
http://www.csee.wvu.edu/~adjeroh/classes/cs110/assessment/submit.html
That is, program codes, and the files for the documentation.
Also, you are required to submit a hardcopy of your assignment documentation (problem solving phase, algorithm design,
verification, test plan, and program listing) in class. (See due dates above).

Partial preview of the text

Download Programming Assignment 4 - Introduction to Computer Science | CS 110 and more Assignments Computer Science in PDF only on Docsity!

1

LCSEE, WVU

CS 110: I NTRODUCTION TO COMPUTER SCIENCE, FALL 2008

PROGRAMMING ASSIGNMENT 4

ANNOUNCED : NOV. 22, 2008

DUE : DEC. 7, 2008, 11:59PM (P ROGRAM C ODES & DOCUMENTATION – S UBMIT COMMAND)

M AX. MARK : 100

Question 1 (Sorting and Searching with Strings) 20 marks (A) Chapter 10, Programming Exercise #8, pp. 692 (B) Chapter 10, Programming Exercise #9, pp. 692 (Note: that the bubble sort program for integers is already in our notes)

Question 2 (Binary Search with and without Recursion) 35 marks (A) Chapter 10, Programming Exercise #13, pp. 962. (B) Repeat (A), but by using a recursive version of the binary search method.

For Part (A), use a user-defined method called binarySearchVectors( ) to perform the binary search. For Part (B), use a recursive version recursiveBinarySearch().

Notes: The book already has a binary search method for arrays in Chapter 10. For this problem, you should use the bubble sort results developed in part (Q1B) above (and not selection sort as suggested in the book).

Question 3 (Koch’s Snowflakes) 35 marks Chapter 14, Programming Exercise #15, pp. 956

Note: This is a simple program, although it may look intimidating at first sight. For this problem, first look at the example on pp. 944 of the book (also in the class handout). You will need the drawLine() method, defined in java.awt.* and GUI components in javax.swing.*. This problem covers materials from Chapters 13 and 14.

Programming Style & Program Organization 10 marks

Further Information

Remember that coding (or implementation) is just one aspect of the problem solving methodology. Projects will be marked based on how well they follow the software development methodology as described in class. Also, see other examples in the book. You could copy the problem as described in the book as your Problem Statement. The Problem Solving phase is mandatory for all the questions. For details on the format for assignment submission, and guidelines for preparing your projects, please see the documents: “CS 110: Preparation and Grading of Programming Projects: The Importance of Professionalism” http://www.csee.wvu.edu/~adjeroh/classes/cs110/general/proj-prep.htm, and “CS 110: Format of Your Programming Projects” http://www.csee.wvu.edu/~adjeroh/classes/cs110/general/prformat.htm

These documents are available from the course web site. Also, see examples in the book (especially the Programming Examples). Submit Command Please submit all files used in your assignment using the submit command: http://www.csee.wvu.edu/~adjeroh/classes/cs110/assessment/submit.html That is, program codes, and the files for the documentation. Also, you are required to submit a hardcopy of your assignment documentation (problem solving phase, algorithm design, verification, test plan, and program listing) in class. (See due dates above).