Currently working on a magazine in my printing class, It's going to be about games and such.
Also I finish making my calendar quite some time ago.
Also I finish making my calendar quite some time ago.
Hm. That kind of assignment seems quite popular considering my entire close family made books, each with their own unique quirks.Yoshidude1 said:I have to write a book about poetry. :-\
Luigidenne3DSGCN said:Hm. That kind of assignment seems quite popular considering my entire close family made books, each with their own unique quirks.Yoshidude1 said:I have to write a book about poetry. :-\
What class?MattC said:it's on farms in case you were wondering
Rural PlanningSuperZambezi said:What class?MattC said:it's on farms in case you were wondering
package proj3;
/**
* <p>Title: The Question Class</p>
*
* <p>Description: This class will generate 2 random numbers as well as an operator.
* If addition, both operands will get values that are dependent upon the operator chosen.
* There are additional methods that will return the value of the operands, return the character
* of the operator. It will systematically calculate the numerical sentence and can also display
* the value of that sentence.</p>
*
* @author William Hudson
*/
public class Question
{
//instance variables
private int operand1;
private int operand2;
private char operator;
/**
* default Question constructor
* gets called when an object of the Question Class is instantiated sending nothing
* as an argument. It determines the two operands and the operator to use.
*/
public Question()
{
int addOrSub;
addOrSub = (int) (Math.random() * 2);
if (addOrSub == 0)
{
operator = '+';
operand1 = (int) (Math.random() * 13);
operand2 = (int) (Math.random() * 13);
}
else
{
operator = '-';
operand1 = (int) (Math.random() * 7 + 6);
operand2 = (int) (Math.random() * (operand1 + 1));
}
}
/**
* getOperand1 Method - returns what's stored in the instance variable operand1
* @return an integer that was stored in the instance variable operand1
*/
public int getOperand1()
{
return operand1;
}
/**
* getOperand2 Method - returns what's stored in the instance variable operand2
* @return an integer that was stored in the instance variable operand2
*/
public int getOperand2()
{
return operand2;
}
/**
* getOperator Method - returns what's stored in the instance variable operator
* @return a character that was stored in the instance variable operator
*/
public char getOperator()
{
return operator;
}
/**
* toString Method - returns what's stored in the instance variable operand1
* @return a reference to the String that contains the value of the two operands and the
* character + or - for the operator
*/
public String toString()
{
String str = new String(operand1 + " " + operator + " " + operand2 + " =");
return str;
}
/**
* determineAnswer Method - returns the value of the numerical equation that's stored
* in the declarative variable equal
* @return an integer that was stored in the declarative variable equal
*/
public int determineAnswer()
{
int equal;
if (operator == '+')
{
equal = operand1 + operand2;
return equal;
}
else
{
equal = operand1 - operand2;
return equal;
}
}
}
I had to do a 5 paper for English, and I changed the entire thing eh night before and got a 97%.SuperZambezi said:8 page paper that I waited until the last minute to do - got a 100%. Final grade for the class is an A.![]()
Get a jobVipsoccermaster said:Just finished this semester, though still not sure if I will continue on or get a job. Decisions, decisions...