CSCI 135 Software Design and Analysis, C+
Lab 7
Solution
Saad Mneimneh
Hunter College of CUNY
Lab A: PiggyBank
Consider the following class:
class PiggyBank cfw_
int a[4];
/a[0] quarters
/a[1] dimes
/
CSCI 135 Software Design and Analysis, C+
Lab 8
Solution
Saad Mneimneh
Hunter College of CUNY
Lab A: Skolem
An innite Skolem sequence a[0], a[1], a[2], . . . satises the following two conditions:
for
CSCI 135 Software Design and Analysis, C+
Lab 9
Solution
Saad Mneimneh
Hunter College of CUNY
Lab A: Split
Write a function called split that has the following signature:
char * split(const char * s,
CSCI 135 Software Design and Analysis, C+
Lab 8
Saad Mneimneh
Hunter College of CUNY
Lab A: Skolem
An innite Skolem sequence a[0], a[1], a[2], . . . satises the following two conditions:
for every n
CSCI 135 Software Design and Analysis, C+
Lab 9
Saad Mneimneh
Hunter College of CUNY
Lab A: Split
Write a function called split that has the following signature:
char * split(const char * s, char * t,
CSCI 135 Software Design and Analysis, C+
Lab 7
Saad Mneimneh
Hunter College of CUNY
Lab A: PiggyBank
Consider the following class:
class PiggyBank cfw_
int a[4];
/a[0] quarters
/a[1] dimes
/a[2] nick
CSCI 135 Software Design and Analysis, C+
Lab 6
Solution
Saad Mneimneh
Hunter College of CUNY
Lab A: Caesar cipher
Caesar cipher is a simple method of encryption. In a Caesar cipher each letter in a
w
CSCI 135 Software Design and Analysis, C+
Lab 6
Solution
Saad Mneimneh
Hunter College of CUNY
Lab A: Caesar cipher
Caesar cipher is a simple method of encryption. In a Caesar cipher each letter in a
w
CSCI 135 Software Design and Analysis, C+
Lab 3
Saad Mneimneh
Hunter College of CUNY
Practice loops and nested loops
Lab A: Lucas numbers
Lucas numbers are dened as the following sequence:
n
L(n)
0
2
Csci 135 Exam 2 Review Sheet
Topics for Exam 2:
Chapter 6 Structures and Classes
Chapter 7 Constructors and Other Tools
Chapter 11.1 Separate Compilation
Chapter 12.1 File I / O
Some Sample Questions
Csci 135 Midterm exam 1 Review Sheet
Topics for Exam 1:
Chapter 1 Introduction to C+
Chapter 2 Flow of Control
Chapter 3 Function Basics
Chapter 4 Parameters and Overloading
Chapter 5 Arrays
Some Samp
CSCI 135 Software Design and Analysis, C+
Homework 7
Due 4/11/2014
Saad Mneimneh
Hunter College of CUNY
Problem 1: Parlindromes
A palindrome is a string that reads the same forward and backward when s
CSCI 135 Software Design and Analysis, C+
Homework 5
Solution
Saad Mneimneh
Hunter College of CUNY
Problem 1: Uncertain Bool
Consider the following incomplete class declaration:
class UncertainBool cf
CSCI 135 Software Design and Analysis, C+
Homework 6
Solution
Saad Mneimneh
Hunter College of CUNY
Problem 1: A Point class
Consider the following class declaration for a point in 2D:
class Point cfw_
CSCI 135 Software Design and Analysis, C+
Homework 6
Due 3/28/2014
Saad Mneimneh
Hunter College of CUNY
Problem 1: A Point class
Consider the following class declaration for a point in 2D:
class Point
CSCI 135 Software Design and Analysis, C+
Homework 5
Due 3/21/2014
Saad Mneimneh
Hunter College of CUNY
Problem 1: Uncertain Bool
Consider the following incomplete class declaration:
class UncertainBo