Answer to Question #308769 in C# for Hlomu

Question #308769

Write an application for a furniture company; the program determines the price of a table. Ask




the user to choose one for pine, 2 for oak, or three for mahogany. The output is the name of the




wood chosen as well as the price of the table. Pine tables cost $100, oak tables cost $225, and




mahogany tables cost $310. If the user enters an invalid wood code, set the price to zero. Save




the file as Furniture.cs

1
Expert's answer
2022-03-10T02:09:45-0500
using System;


namespace Furniture


{
    class Program
    {
        static void Main(string[] args)
        {
            int material = -1;
            Console.WriteLine("Enter the material (1 - pine, 2 - oak, 3 - mahogany)");
            material = int.Parse(Console.ReadLine());
            if (material == 1)
                Console.WriteLine("А pine table will cost $100");
            if (material == 2)
                Console.WriteLine("А oak table will cost $225");
            if (material == 3)
                Console.WriteLine("А mahogany table will cost $310");
            if (material != 1 && material != 2 && material != 3)
                Console.WriteLine("А table made of unknown material will cost $0");


        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS