Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSC 490 Fall 2006 Course Notes and Outline for Assignment 0 - Prof. Gary Locklair, Study notes of Computer Science

Instructions and explanations for completing the first assignment in the csc 490 course offered by dr. Gary locklair in fall 2006. Students are required to read chapter 1 of an unspecified text, understand the wallpaper algorithm, and implement the algorithm using c++. The document also covers concepts such as abstraction, effective algorithms, and modulo operation.

Typology: Study notes

Pre 2010

Uploaded on 07/23/2009

koofers-user-iva-1
koofers-user-iva-1 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
5 September, Day 3
Written Assignment#0 due dates review – note thread online
Systems Assignment #0 due [next time on Chemnitz Student Data]
CSC490 is the most important class you have …
Example, Chapter 1
Read the entire chapter straight through
(ignoring things you don’t understand immediately)
{an application of abstraction }
Then, reread the chapter for cognition (comprehension)
Refer to other resources (other texts, eg Great Ideas…)
effective = computable in a reasonable time
Page 7
Problem 1 – first part was straightforward
- second part was meant to illustrate a concept
namely, computers are dumb
Problem 2 – how would you approach it?
first, understand the problem
understand WALLPAPER algorithm
general design pattern: Outputs – Inputs – Processing
ensure by actually creating and running code
first, understand output (look at page 4) {TEST}
remember, create applications by specifying outputs
first,
then inputs, and finally algorithm
“deskcheck” or “walkthrough” on algorithm
i.e. “playing computer”
algorithm on page 3
[note: add subnumbers 1-4 on inner loop statements]
corna, cornb are the lower left corner of the image
think of them as an “offset” for the “picture” from
0,0
image is created as a raster or bit map image
envision co-ordinate system across CRT
horizontal 0-640 (VGA)
vertical 0-480 (VGA)
side is ?? {students will determine in homework}
x and y are …
the location to “plot” or are they?
note: we need meaningful variable names
“plot” writes a “dot” (no “plot” means no dot)
CSC 490 Course Notes and Outline, © Dr. Gary Locklair, Fall 2006
pf3

Partial preview of the text

Download CSC 490 Fall 2006 Course Notes and Outline for Assignment 0 - Prof. Gary Locklair and more Study notes Computer Science in PDF only on Docsity!

5 September , Day 3 Written Assignment#0 due dates review – note thread online Systems Assignment #0 due [next time on Chemnitz Student Data] CSC490 is the most important class you have … Example, Chapter 1 Read the entire chapter straight through (ignoring things you don’t understand immediately) {an application of abstraction } Then, reread the chapter for cognition (comprehension) Refer to other resources (other texts, eg Great Ideas …) effective = computable in a reasonable time Page 7 Problem 1 – first part was straightforward

  • second part was meant to illustrate a concept namely, computers are dumb Problem 2 – how would you approach it? first, understand the problem understand WALLPAPER algorithm general design pattern: Outputs – Inputs – Processing ensure by actually creating and running code first, understand output (look at page 4) {TEST} remember, create applications by specifying outputs first, then inputs, and finally algorithm “deskcheck” or “walkthrough” on algorithm i.e. “playing computer” algorithm on page 3 [note: add subnumbers 1-4 on inner loop statements] corna, cornb are the lower left corner of the image think of them as an “offset” for the “picture” from 0, image is created as a raster or bit map image envision co-ordinate system across CRT horizontal 0-640 (VGA) vertical 0-480 (VGA) side is ?? {students will determine in homework} x and y are … the location to “plot” or are they? note: we need meaningful variable names “plot” writes a “dot” (no “plot” means no dot)

what is int function? truncate to integer value (6.75 becomes 6) if c is even, then “plot” ie location i,j is black if c is odd, then don’t “plot” ie location i,j is white OK, that’s algorithm How does it work? Read top of page 5 Now, for an implementation. See pages 6- Back to page 3 Good question … how do we determine if c is even or odd (3.1.4)? Look at implementation on page 7 What is modulo (ie the mod function)? note he didn’t define in text, but used it in program on page 7! use other resource to look up if you don’t know (eg, CS:AO defines modulo on page 514 of 9th^ ed.) Modulo is “remainder after division” 7/3 is 2 remainder 1, thus 7 mod 3 is 1 note that a test for an even number is X mod 2 = 0 You should implement the original algorithm and test it ie run it before modifying the algorithm to solve the problem Creating the original algorithm will solidify many concepts and answer many necessary questions Create code using C++

  • simulate pixels (bitmap) with “X” and “ ” (space)
  • use a 10x10 matrix
  • create pattern from top to bottom a line at a time
  • solve problem 2 also with “x” “y” and “ ” (space) decipher problem 2 hint: residue classes of a number taken to mod 2 … implementation issues:
  • operator precedence
  • variable typing