#C# / Lucian's Luscious Lasagna

4 messages · Page 1 of 1 (latest)

wise mulch
#

This is my code

class Lasagna
{
    // TODO: define the 'ExpectedMinutesInOven()' method
    public int ExpectedMinutesInOven()
    {
        int time = 40;
        return time;
    }
    // TODO: define the 'RemainingMinutesInOven()' method
    public int RemainingMinutesInOven(int minutes)
    {
        int total = 40 - minutes;
        return total;
    }
    
    // TODO: define the 'PreparationTimeInMinutes()' method
    public int PreparationTimeInMinutes(int minutes)
    {
        int total = minutes*2;
        return total;
    }
    
    // TODO: define the 'ElapsedTimeInMinutes()' method
    public int ElapsedTimeInMinutes(int layers, int minutes)
    {
        int total = (layers*2)+(40-minutes);
        return total;
    }
    
}

var lasagna = new Lasagna();
lasagna.ExpectedMinutesInOven();

these are my errors

LuciansLusciousLasagna.cs(32,1): error CS8803: Top-level statements must precede namespace and type declarations.
LuciansLusciousLasagna.cs(32,1): error CS8805: Program using top-level statements must be an executable.

ive tried to extensively google the issue online and it makes no sense

keen ore
#
var lasagna = new Lasagna();
lasagna.ExpectedMinutesInOven();

remove these 2 lines, the test runner doesnt want them

#

another tip for the future, the error show you which line give the problem
which is 32 in this case, which is the line
var lasagna = new Lasagna();

wise mulch
#

not new to coding, just to C# - just didnt understand why it refused to accept anything at all but now that i know i'll avoid doing that on exercism 👍