Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.149.27.33
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/snbittner/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/snbittner/hw7_212.cpp
//
//	CS 212 Computer Programming II Assignment VII
//	Due: Monday April 20, 2011
//
//	File: hw7_212
//	Author: Stephanie Bittner
//	Instructor: Dr. Wang
//
//	Compile: g++ hw7_212.cpp
//	Run: ./a.out < data7.txt
//
//	Goal: The program will read a set of pixels from a file and output 
//		the coordinate lengths to one decimal only for the pixel 
//		that is ON.
//

#include <iostream>
#include <iomanip>

using namespace std;

#include "point.h"
#include "pixel.h"

int main()
{
	cout << fixed << showpoint << setprecision(1);

	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 coordinate is: ";
			px2.Print();
			cout << "\n" << "The distance is: " << px2.Distance(px1) << "\n\n";
		}
		
		else if(str == "OFF")
		{
			status = OFF;
		}
		
		cin >> a >> b >> str;
		
	}
	cout << "\n\n";
	
	return 0;
}

Stv3n404 - 2023