Click here to Skip to main content
See more: C#
iv done the finished the program but only the basics, so i need help on adding a few features
 
here is what is needed of the program
 
-------------------------------------------------------
 
Design a program to be used by an interior decorator to estimate the cost of painting a room. The decorator needs to enter the height of the room (between 2 and 6 metres), then the length of all four walls (minimum 1 metre; maximum 25 metres). The program should then calculate the total area of the room.
 
The program should allow a choice of three paints:
 
• Luxury quality which costs £1.75 per square metre
• Standard quality which costs £1.00 per square metre
• Economy quality which cost £0.45 per square metre
 
The decorator should also be able to choose to use undercoat paint if required, which costs an additional £0.50 per square metre.
 
The program should display an itemised bill with a total.
 
----------------------------------------------------
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string Choice, Choice2;
            double Luxury, Standard, Economy, undercoat;
            double height, length1, length2, Total, Area;
 

            Luxury = 1.75;
            Standard = 1.00;
            Economy = 0.45;
            undercoat = 0.50;
 
            {
                Console.Write("Please choose which paint you want");
                Console.WriteLine(" A) Luxury B) Standard C) Economy");
                Choice = Console.ReadLine();
                Console.Clear();
                if (Choice == "a")
                {
                    Console.Write("Please Enter the height of the room that is between 2 and 6 meters");
                    height = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("please enter the lengh of your room wall");
                    length1 = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("please enter the width of your room");
                    length2 = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("Would you like to use an undercoat");
                    Console.WriteLine("A) Yes B) No");
                    Choice2 = Console.ReadLine();
                    Console.Clear();
                    if (Choice2 == "a")
                    {
                        Area = 2 * (length1 + length2) + 2 * (length1 + height) + 2 * (length2 + height);
                        Total = (Area * Luxury) + (undercoat * Area);
                        Console.WriteLine("The total price of painting the room is {0}", Total);
                        Console.ReadLine();
                    }
                    else if (Choice2 == "b")
                    {
                        Area = 2 * (length1 + length2) + 2 * (length1 + height) + 2 * (length2 + height);
                        Total = (Area * Luxury);
                        Console.WriteLine("The total price of painting the room is {0}", Total);
                        Console.ReadLine();
                    }
                }
                if (Choice == "b")
                {
                    Console.Write("Please Enter the height of the room that is between 2 and 6 meters");
                    height = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("please enter the lengh of your room wall");
                    length1 = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("please enter the width of your room");
                    length2 = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("Would you like to use an undercoat");
                    Console.WriteLine("A) Yes B) No");
                    Choice2 = Console.ReadLine();
                    Console.Clear();
                    if (Choice2 == "a")
                    {
                        Area = 2 * (length1 + length2) + 2 * (length1 + height) + 2 * (length2 + height);
                        Total = (Area * Luxury) + (undercoat * Area);
                        Console.WriteLine("The total price of painting the room is {0}", Total);
                        Console.ReadLine();
                    }
                    else if (Choice2 == "b")
                    {
                        Area = 2 * (length1 + length2) + 2 * (length1 + height) + 2 * (length2 + height);
                        Total = (Area * Standard);
                        Console.WriteLine("The total price of painting the room is {0}", Total);
                        Console.ReadLine();
                    }
                }
                if (Choice == "c")
                {
                    Console.Write("Please Enter the height of the room that is between 2 and 6 meters");
                    height = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("please enter the lengh of your room wall");
                    length1 = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("please enter the width of your room");
                    length2 = Double.Parse(Console.ReadLine());
                    Console.Clear();
                    Console.WriteLine("Would you like to use an undercoat");
                    Console.WriteLine("A) Yes B) No");
                    Choice2 = Console.ReadLine();
                    Console.Clear();
                    if (Choice2 == "a")
                    {
                        Area = 2 * (length1 + length2) + 2 * (length1 + height) + 2 * (length2 + height);
                        Total = (Area * Luxury) + (undercoat * Area);
                        Console.WriteLine("The total price of painting the room is {0}", Total);
                        Console.ReadLine();
                    }
                    else if (Choice2 == "b")
                    {
                        Area = 2 * (length1 + length2) + 2 * (length1 + height) + 2 * (length2 + height);
                        Total = (Area * Standard);
                        Console.WriteLine("The total price of painting the room is {0}", Total);
                        Console.ReadLine();
                    }
                }
            }
        }
    }
}
 

can u guys help me to add event handlers for the choice questions
and for the input lengths as the height need to be between 2 - 6, length 1-25
 
oh and im not sure the actual equation to work out the surface area is right. this is my second big program and i need to finish it in a day so this program probably looks stupid to u
Closed because The post is not clear, or is incomplete and has not been phrased in a way that allows it to be fully understood.. Reported by RyanDev, ThePhantomUpvoter on Saturday, July 27, 2013 3:00pm.
Posted 20-Apr-13 8:16am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,055
1 DamithSL 4,621
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,500
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100