38 lines
875 B
C#
38 lines
875 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
|
|||
|
class SoilProperties
|
|||
|
{
|
|||
|
static Random r = new Random();
|
|||
|
|
|||
|
|
|||
|
public string soilType = "potato";
|
|||
|
public float Temparature;
|
|||
|
public float Humidity;
|
|||
|
public float Moisture;
|
|||
|
public float Nitrogen;
|
|||
|
public float Potassium;
|
|||
|
public float Phosphorous;
|
|||
|
|
|||
|
public void setSoilProperties()
|
|||
|
{
|
|||
|
Temparature = GetRandomNumber(22, 30);
|
|||
|
Humidity = GetRandomNumber(1, 5);
|
|||
|
Moisture = GetRandomNumber(1, 10);
|
|||
|
Nitrogen = GetRandomNumber(0.5 , 1);
|
|||
|
Potassium = GetRandomNumber(5, 20);
|
|||
|
Phosphorous = GetRandomNumber(4, 50);
|
|||
|
}
|
|||
|
|
|||
|
public float GetRandomNumber(double minimum, double maximum)
|
|||
|
{
|
|||
|
return (float)(Math.Round(r.NextDouble() * (maximum - minimum) + minimum, 2));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|