All pastes #436028 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-12 09:36 UTC
rendered paste body
/*********************************
Name:Skupien
Vorname:Adrian 

MkNr:661348	
Datum:12.04.2007

*********************************/

//Bibliotheken einbinden
#pragma once
# include <iostream>
# include <string>
#include <sstream>

using namespace std;
class Logic
{


private:
	bool input_a;
	bool input_b;
	int choice;
public:
	void setInputA(bool a);
	void setInputB(bool b);
	bool getOutput();
	void setFunction (int);
	void test();

};

void Logic::setInputA(bool a)
	{
		input_a=a;
	};

void Logic::setInputB(bool b)
	{	
		input_b=b;
	};


bool Logic::getOutput()
	{
	if (choice == 1)
		return input_a && input_b;

	if (choice == 2)
		return input_a || input_b;

	if (choice == 3)
	{
		if (input_a == true && input_b == true)
			return false;

		if (input_a == false && input_b == true)
			return true;

		if (input_a == true && input_b == false)
			return true;

		if (input_a == false && input_b == false)
			return false;
	};
};
	void Logic::setFunction(int choice_input)
{
	choice=choice_input;
};