Homework 1, due Friday, September 23
Homework 2, due Friday, April 28
(5 points each)
1. Rewrite your homework 1 to use a function that takes a string as its argument. If the string consists of eight 1's and 0's, the function returns the corresponding 'char'. If it does not, the function throws an exception. Use this in a main function that allows the user enter 1's and 0's to write a binary file. When the file is read back using a routine like the one in bitWrite.cpp, the screen should show the sequence of 1's and 0's the user entered.
Implement this project in three files, a .h file that contains the declarations of all functions you write, a .cpp file that contains their definitions, and a .cpp file with the main function.
Include a makefile for compiling your executable.
2. An inversion in a sequence of numerical values is a pair of values in the sequence for which the first value occurs before the second in the sequence and is greater than the second. For example, in the sequence 3, 2, 4, 1, the pairs (3, 2), (3, 1), (2, 1), and (4, 1) are inversions. Write a function that reads int values from the keyboard, stores them in a list, and returns the list. Write another function that takes a list of ints as its parameter and returns the number of inversions in the list. This function should use iterators on the list. Write a main the demonstrates the functions.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- prelab exercises moore public schools
- this program is supposed to read a lot of strings typed by
- some basic sml examples
- table of contents
- cs 1301 ch 6 handout 1
- visual basic for c programmers
- arrayprioritylist
- c standard template library an introduction
- homework 1 due friday september 23
- add a method to the searching class to list all the
Related searches
- due on or due by
- due by vs due on
- practice homework 23 theoretical yield and percent yield calculations
- photosynthesis homework 1 answer key
- 1 23 infantry tomahawks
- 1 23 infantry battalion address
- 1 23 infantry battalion
- mark 1 23 28 commentary
- lesson 1 homework practice
- lesson 1 homework practice lines
- 23 int 1 1 sqrt x dx
- lesson 1 homework practice answers