Server IP : 172.16.15.8 / Your IP : 52.15.170.196 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/bnhans/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// // CS Assignment 7 // Due: 18th April 2011 // // File: assignment7.cpp // Author: Brittani Hans // Instructor: Dr. WAng // // Compiling: g++ assignment7.cpp // Running: ./a.out < data7.txt // Goal: Read a set of pixels from a file to the objhect of Pixel class. // Then output the lenght and coordinates only of pixel 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; cout << fixed << showpoint << setprecision(1); cin >> a >> b >> str; while(cin) { if( str == "ON" ) s = ON; px.Set(a, b, s); cout << "The coordinents - "; px.Print(); cout << "\nThe distance - " << px.Distance (origin) << "\n"; cin >> a >> b >> str; } cout << "\n\n"; return 0; }