0% found this document useful (0 votes)
31 views1 page

CS II Exam 1 Study Guide Overview

The CS II Exam 1 Study Guide outlines the topics covered in the exam, including Abstract Data Types, class definitions, operator overloading, and software testing. It specifies that the exam is closed book and comprehensive, and provides sample questions that reflect the exam format. Notably, commands related to make, svn, or Unix are excluded from the exam content.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views1 page

CS II Exam 1 Study Guide Overview

The CS II Exam 1 Study Guide outlines the topics covered in the exam, including Abstract Data Types, class definitions, operator overloading, and software testing. It specifies that the exam is closed book and comprehensive, and provides sample questions that reflect the exam format. Notably, commands related to make, svn, or Unix are excluded from the exam content.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CS II: Study Guide for Exam 1 J.

Maletic

Exam 1 Study Guide

The exam is closed book and closed notes. It is comprehensive and includes all materials covered
during the term so far, in lecture, lab, and on the projects.

Topics covered:
• Abstract Data Type definition
• ADTs: set, point, string, bigint
• Class, constructors, operator overloading
• Const methods
• Pre, post conditions, invariants, assertions
• Software testing
• Overloading I/O operators

Not on the exam: make, svn, or Unix commands

Sample Exam Questions

These questions are representative of the types and format of the exam questions. The
instructor has given similar questions in the past.

1. Given the class definition below, write a member function that checks if two strings (as
defined below) are equal. Give REQUIRES and ENSURES conditions for the operator==
you write.
class String {
public:
string() { s[0] = 0; };
bool operator==(const String&) const;

private:
char s[256]; //null terminated character array
};

2. What are the three components of an abstract data type (ADT)?

3. Overload operator>> for the string class defined in problem 1. You can assume it is a
friend function. Read in a string from a stream until a semicolon (;) is read. Blanks MUST
be included into the string, but the end of line character or semicolon should NOT. You do
not need to check for end of file.

4. Overload operator<< for the bigint class in project 1. You can assume it is a friend
function. Output such that there are a maximum of 60 digits per line. Assume there is a
constant value called BIGINT_CAPACITY.

You might also like