


























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























































int main() { double xStart = 1.2; double xEnd = 2.0; double yStart = 0.4; double yEnd = 1.6; }
void printVector(double x0, double x1, double y0, double y1) { cout << "(" << x0 << "," << y0 << ") - > (" << x1 << "," << y1 << ")" << endl; }
int main() { double xStart = 1.2; double xEnd = 2.0; double yStart = 0.4; double yEnd = 1.6; printVector(xStart, xEnd, yStart, yEnd); // (1.2,2.0) - > (0.4,1.6) }
name
class Vector { public: double xStart; double xEnd; double yStart; double yEnd; };
class MITStudent { public: char *name; int studentID; };
MITStudent
name studentID
student
name =?
studentID =?
student
name =?
studentID =?
class MITStudent { public: char *name; int studentID; };
int main() { MITStudent student1; MITStudent student2; student1.name = "Geza"; }
student
student
name = “Geza”
studentID =?
name =?
studentID =?
student
student
name = “Geza”
studentID = 123456789
name =?
studentID =?
class MITStudent { public: char *name; int studentID; };
int main() { MITStudent student1; MITStudent student2; student1.name = "Geza"; student1.studentID = 123456789; }
class MITStudent { public: char *name; int studentID; };
int main() { MITStudent student1; MITStudent student2; student1.name = "Geza"; student1.studentID = 123456789; student2.name = "Jesse"; student2.studentID = 987654321; cout << "student1 name is" << student1.name << endl; cout << "student1 id is" << student1.studentID << endl; cout << "student2 name is" << student2.name << endl; cout << "student2 id is" << student2.studentID << endl;Docsity.com
Start = (0.4, 0.8)
End = (0.9, 1.5)
coordinate
start and a finish
coordinate
start and a finish
class Vector { public: double xStart; double xEnd; double yStart; double yEnd; };
Vector
xStart xEnd yStart yEnd
Start = (0.4, 0.8)
End = (0.9, 1.5)
(^) Doesn’t show that coordinates can be grouped into points
Start = (0.4, 0.8)
End = (0.9, 1.5)
coordinate
start and a finish
Point
x y
class Point { public: double x; double y; };