CIS25 – C++ Programming
Cover Sheet (use the sample copy include in class/lecture note)
Exercise/problem statement
Copy of your source file (C++ program named as
cis25Fall2019YournameHw5Ex1.cpp)
Copy of output (copy and paste to the end of your program as PROGRAM OUTPUT COMMENT block)
Copy of a COMMENT block on Logic_Code_Output Issues (as a separate comment block) after your PROGRAM OUTPUT
All other supportive files of h, fractionYourName.cpp, fractionUltilityYourName.h, fractionUtilityYoutName.cpp, PointYourName.h, PointYourName.cpp, PointUltilityYourName.h, PointUtilityYoutName.cpp, etc.
Submitting in class one hard copy for each exercise
Emailing each document as follows,
One message for each
Attaching the source file that was created in Part a).
The SUBJECT line of the message should have the following line:
cis25Fall2019YourNameHw5Ex1
Q.E.D.
Code Assignment/Exercise
EXERCISE 1
Consider the following classes:
class FractionYourName; // From previous work and
// to be updated as discussed or needed class PointYourName; // To Be Created
The incomplete class definitions and code are given as follows (and to be updated as given in class discussions),
// Header/Specification Files
/**
Program Name: h
Discussion: Declaration File -–
FractionYourName class
*/
#ifndef FRACTIONYOURNAME_H #define FRACTIONYOURNAME_H
class FractionYourName { public:
// YOUR CODE HERE
// Must have at least the default constructor,
// copy contructor,
// destructor, and
// assignment operator function
// and other members
private:
int num; // numerator will preserve fraction-negativity;
// i.e., negativity of a fraction will be
// assigned to its numerator
int denom; // non-zero value for denominator
};
// your I/O OPERATOR functions here #endif
/**
Program Name: h
Discussion: Declaration File --
PointYourName Class
*/
#ifndef POINTYOURNAME_H #define POINTYOURNAME_H
#include "fractionYourName.h"
// Declarations
class PointYourName { public:
// YOUR CODE HERE
// Must have at least the default constructor,
// copy contructor,
// destructor, and
// assignment operator function
// operations
int getQuadrant() const {
// YOUR CODE HERE
}
int getQuadrant(const PointYourName& p) const {
// YOUR CODE HERE
}
void moveBy(const FractionYourName& delX, const FractionYourName& delY) {
// YOUR CODE HERE
}
void moveBy(int iOld) { // update as needed
// YOUR CODE HERE
}
void flipByX() { // update as needed
// YOUR CODE HERE
}
void flipByY() { // update as needed
// YOUR CODE HERE
}
void flipThroughOrigin() { // update as needed
// YOUR CODE HERE
}
void print() const { // update as needed
// YOUR CODE HERE
}
// add operator functions as needed private:
FractionYourName x; // x-coordinate of the point FractionYourName y; // y-coordinate of the point
};
// your I/O OPERATOR functions here #endif
You are asked to
Add more member functions and operator functions as needed for the Point class; and
Provide complete definitions for all member functions so that the given class is proper and working properly; and
Add/Provide complete definitions for all needed non-member functions to perform reasonable tasks; and
Save all classes in appropriate *.h and *.cpp files with appropriate names; and
Run a menu program named as with a driver named as cis25Fall2019YourNameHW5Ex1.cpp (and save the output at the end of this driver).
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of