Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.
/ interview-product Public archive

Task with the interview about the characteristics of the product.

License

Notifications You must be signed in to change notification settings

liannoi/interview-product

Repository files navigation

Product

The task of the interview, given to me by a teacher at the computer academy STEP. I completed it in two hours and received a 12/12 evaluation.

The text of the task is as follows:

A product has two characteristics: view and type of product.

Write a program in C#, which, depending on the choice of these characteristics,
will implement the rounding of the entered weight. Rounding can be of two
types: mathematical and rounding up, and taking into account up to 1, 2 or 3
decimal places.

Examples

internal class Program
{
    private static void Main(string[] args)
    {
        Models.Product product = new Models.Product
        {
            View = new View
            {
                // ...
                RoundMode = RoundMode.Greater
            },
            Type = new Models.Type
            {
                // ...
                RoundMode = RoundMode.Math
            },
            
            Weight = 3.14M
        };
        
        Console.WriteLine(product.Weight);
    }
}

Output: 3

internal class Program
{
    private static void Main(string[] args)
    {
        Models.Product product = new Models.Product
        {
            View = new View
            {
                // ...
                RoundMode = RoundMode.Greater
            },
            Type = new Models.Type
            {
                // ...
                RoundMode = RoundMode.Greater
            },
            
            Weight = 3.14M
        };
        
        Console.WriteLine(product.Weight);
    }
}

Output: 3.14

License

The repository is licensed by Apache-2.0.

About

Task with the interview about the characteristics of the product.

Topics

Resources

License

Stars

Watchers

Forks

Languages