using System;
using System.Drawing.Text;

namespace ChamaBasinMiner
{
    internal class Minerals
    {
        String symbol;
        String name;
        double marketRate;
        int tonnage;
        int min = 1;
        int max = 200;
        public Minerals()
        {
            symbol = "";
            name = "";
            marketRate = setMarketRate();
            tonnage = 0;
        }

        public Minerals(String symbol, String name, int tonnage)
        {
            this.symbol = symbol;
            this.name = name;
            this.tonnage = tonnage;
            marketRate = setMarketRate();
        }

        //STUDENT POINT
        private double setMarketRate()
        {
            Random r = new Random();  //SC12
            marketRate = (r.NextDouble() * ((max - min) + 1) + min);
    
            return marketRate;
        }
        //STUDENT POINT
        public double getValue()  //SC13
        {
            double temp = marketRate * tonnage;
            
            return temp;
        }
        //STUDENT POINT
        public String toString()  //SC14
        {
            return "[Mineral Symbol: " + symbol + "].[" + "Mineral Name: " + name + "].[" + " Market $/ton: $" + String.Format("{0:0.00}", marketRate) + "].[" + " Total Tonnage Mined: " + tonnage + "].[" + "Estimated Market Value: $" + String.Format("{0:0.00}", this.getValue())+"]";
        }
    }
}
