{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cpp_lab1_f07 - CGS 2425 LAB EXAM 1 Integer Stream This...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CGS 2425 LAB EXAM 1: Integer Stream This assignment deals with representing a number stream in a compact way. A typical number stream (shown below) consists of blocks of repeated numbers. 1 1 1 1 1 0 0 0 0 3 3 1 1 1 1 2 2 2 It starts with a block of 5 ones, and continues with block with number 0 and length 4, and so on. Our objective is to write a program that represents the above number stream in compressed format. The compressed format will replace an entire block of consecutively repeated numbers with two numbers: value and repetition count (length). Repetition count 1 | 5 | 0 | 4 | 3 | 2 | 1 | 4 | 2 | 3 Value The original stream will be stored in an ASCII data file. We will assume that there will be no more than 100 numbers in the steam. Your program will open the data file and transfer the stream into an integer array. It will then find the length of each block and construct the compressed stream in a second array. You will develop three functions:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

cpp_lab1_f07 - CGS 2425 LAB EXAM 1 Integer Stream This...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online