Tag: CMPT135

CMPT 135: Assignment 1- A Dynamic String Array

IT and WebprogrammingTechnical PapersArraysCMPT 135CMPT135Simon Fraser University

Assignment 1: A Dynamic String Array

In this assignment your task is to implement, and test, a set of functions that implement a dynamic array of strings.

Getting Started

For this assignment, put all the code you write into a single file named a1.cpp. that starts like this:

// a1.cpp

/////////////////////////////////////////////////////////////////////////
//
// Student Info
// ------------
//
// Name : <put your full name here!>
// St.# : <put your full SFU student

VIEW SOLUTION

CMPT 135: An Object-oriented Dynamic String Array

IT and WebprogrammingSource CodeTechnical PapersArraysc plus plusCMPT 135CMPT135Simon Fraser University

Assignment 2: An Object-oriented Dynamic String Array

In this assignment your task is to essentially re-do a assignment 1, but this time using object-oriented programming. The resulting str_vec class is much easier to use than the version in assignment 1 because it manages its memory automatically.

Getting Started

For this assignment, all the code you write should be put into a file named a2.cpp that looks like this:

// a2.cpp

/////////////////////////////////////////////////////////////////////////
//
// Student Info
// ------------
//
// Name : <put your full name here!>
// St.# : <put your full SFU student

VIEW SOLUTION

CMPT 135 Assignment 3: Chatbots

IT and Webprogrammingc plus pluschatbotsCMPT 135CMPT135SFUSimon Fraser University

Assignment 3: Chatbots In this assignment your task is to implement and test a number of different chatbots. Each different chatbot is implemented in a class that inherits from the Chatbot base class given below. Getting Started For this assignment, all the code you write should be put into a file named a3.cpp that looks…

This content is for IT & Web programming task members only.Log In Register VIEW SOLUTION

CMPT 135 Assignment 4 Recursion

GithubIT and WebprogrammingCMPT 135CMPT135

Assignment 4: Recursion

In this assignment, your task is to practice writing recursive functions. The questions are in the file a4.h, and each question asks you to write a recursive function according to a specification given in the source code itself.

The functions are specified using pre-conditions, post-conditions, and constraints. For example, here is the specification for a function that sums the integers from 1 to n:

// Pre-condition:
//    n >= 0
// Post-condition:
//    Returns the sum of the first n integers, i.e. 1 + 2 + 3 + ... + n.
//    If n is 0, then 0 is returned.
// Constraints:
//    Must be implemented using recursion (and no loops). You can write
//    helper functions if necessary.
// Note:
//    You don't need to worry about sums that overflow int.
int sum(int n);

The pre-condition states what must be true before the function is called, and the post-condition states what must be true after the functions finishes running correctly (assuming that the pre-condition held before it was called).

The constraints part of the specification lists any other things that must be true for the function. In this assignment, the major constraint is that no loops are allowed in any of the code you write.

Important: No loops are permitted in any of the code you write for this assignment (not even in the test functions).

Testing

For each function, you must also write a corresponding test function that automatically runs tests on the function to help ensure it is working correctly. Typically, this is a series of assert statements that call the function and compare its results to the known correct answer.

For example, the test function for sum from above could be written like this:

void

VIEW SOLUTION

CMPT 135 A Personal Database

GithubIT and WebCc plus plusCMPT 135CMPT135personal database

A Personal Database In this project, you are to design and implement a book database. Your database will store book records, and each book records has, at least, these fields: Title Author Date of publication Book type: hardcover, softcover, or digital ISBN # (yes, there is more than one kind of ISBN — it’s your…

This content is for IT & Web programming task members only.Log In Register VIEW SOLUTION