1 create a class called evaluatevalue that declares 3


1. Create a class called evaluateValue that declares 3 integer class variables: zeroValue, positiveValue and negativeValue. These should be declared as public and you should not use automatic properties to declare them.

2. Your class should have a constructor that takes one integer argument.  In the constructor you will code if statements to set one of the three class variables (indicators) to 1 if the number sent to the constructor is either equal to zero, negative, or positive.

3. In the class provide a method printit() used to print the results
       Evaluate the positive, negative, and zero indicator
           to determine which line to print. If the indicator
           is set to 1 then the indicator is true. 
      You will print one of three statements; 
           The number was zero.
           The number was positive.
           The number was negative.

4. In the default wrapper class named assignment3 and containing Main write the code in Main that declares one integer variable: val1.

5. Use Console Write and Readline and the convert method to take the integer entry from the keyboard and pass it to the evaluateValue constructor.

6. Instantiate an evaluateValue object and pass the integer values to the constructor.

7. From Main call the printit method which will print the resulting evaluation in the class object.

The output might look like this:

 

Below is what I have been able to write

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Linq;


namespace Assignment3
{
class evaluateValue
{
//Create a class called evaluateValue that declares 3 integer class variables: zeroValue, 
// positiveValue and negativeValue. These should be declared as public and you should not 
//use automatic properties to declare them.

public int zeroValue;
public int positiveValue;
public int negativeValue;

public evaluateValue(int val1)
{



}
public void printit()
{


}
}
class assignment3
{
public static void Main(string[] args)
{
//declare the local val1 variable

int val1;

//prompt the user for input of one integer

Console.Write( " Enter an integer value: ");
val1 = Convert.ToInt32(Console.ReadLine() );



//instantiate a evaluateValue object here
// and pass val1 to the constructor
evaluateValue = new myValue(val1);


//call the object method printit here
myValue.printit();

}
}
}

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: 1 create a class called evaluatevalue that declares 3
Reference No:- TGS01116897

Expected delivery within 24 Hours