locked
CO2 Calculator RRS feed

  • Question

  • User1709213928 posted

    Hello ASP.NET..

    I want to ask if its possible to make a co2 calculator in asp.net (MVC).

    I know for sure you can make one, but i dont know where to start, or how to start.

    Thanks for the help!

    Monday, February 1, 2016 10:17 AM

Answers

  • User281315223 posted

    Well you would first likely need to determine some type of formula for calculating what you need (as I am not sure what all a CO2 calculator would entail) :

    public double CalculateYourCO2(int x, int y, int z)
    {
         // do your magic here
    }

     After you have your formula defined, you would likely just want to build some type of form that would allow your user to type in certain parameters that they would be using (e.g. room dimensions, flow rates, etc.). When the user submitted the form, you could read these values, pass them into your formula and return your calculation results to the user :

    [HttpPost]
    public ActionResult Index(int parameterName1, int parameterName2, int parameterName3)
    {
          // read your values
          var result = CalculateYourCO2(parameterName1, parameterName2, parameterName3);
          // Do something with your result here
          return Content($"Your result is {result}!");
    }
    

    I would highly recommend reading through a very basic tutorial on MVC on how to make a basic page that can accept input and how to handle output and then going from there. The Learn section of this site is a great place to get started.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 1, 2016 6:40 PM