1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lilit [14]
3 years ago
13

A method to accept the number of drawers in the desk as input from the key board. This method returns the number of drawers to t

he SelectDesk_Click event.  A method to accept an input and return the type of wood, m for mahogany, o for oak, or p for pine.  A method that accepts the number of drawers and wood type and calculates the cost of the desk based on the following o Pine desks are $100 o Oak desks are $140 o All other woods are $180 o A $30 surcharge is added for each drawer. o This method returns the cost to the SelectDesk_Clic
Computers and Technology
1 answer:
Julli [10]3 years ago
5 0

Answer:

Following code takes the information about the wood from the user, do the process of calculating the value according to there type and numbers, then add the surcharge to it while giving the answer to the user.

For differentiating the type of woof i used the if then else statement while i used switch case statement for assigning the appropriate value according to the types of the wood will be processing in the program.

The code is given below:

Explanation:

Code:

namespace std;\\ any name instead of std.

{

   class Program

   { \\ starting the main program

       static void Main(string[ ] args)

       {

           int numberOfDrawers = 0;

           string deskWoodType = "o";

           double cost = 0;

           drawersMeth(numberOfDrawers);

           woodTypeMeth(deskWoodType);

           CalculateCostMeth(numberOfDrawers, cost, deskWoodType);

           OutPutCostMeth(deskWoodType , cost, numberOfDrawers);

       }//end main

       private static void drawersMeth(int numberOfDrawers)

       {

           int numOfDrawers;

           Console.WriteLine("Enter the number of desk drawers");

           numOfDrawers = Convert.ToInt16(Console.ReadLine());

           numberOfDrawers = numOfDrawers;

       }//end drawersMeth

       private static string woodTypeMeth(string deskWoodType)

       {

           Console.WriteLine("Enter the desk wood type. (eg. type mahogany, oak, or pine)");

           deskWoodType = Convert.ToString(Console.ReadLine());

           switch (deskWoodType)

           {

               case "mahogany":

                   {

                       deskWoodType = "m";

                       break;

                   }

               case "oak":

                   {

                       deskWoodType = "o";

                       break;

                   }

               case "pine":

                   {

                       deskWoodType = "p";

                       break;

                   }

               default:

                   {

                       deskWoodType = "error";

                       break;

                   }

           }

           return deskWoodType;

       }// end woodTypeMeth

       private static int CalculateCostMeth(string deskWoodType, int numberOfDrawers, int cost)

       {

           int pine = 100;

           int oak = 140;

           int other = 180;

           int surchage = 30;

           if (deskWoodType == "p")

               cost = surchage + (numberOfDrawers *pine );

           else if (deskWoodType == "o")

               cost = surchage + (numberOfDrawers *oak );

           else

               cost = surchage + (numberOfDrawers *other );

           return cost;

       }// end CalculateCostMeth

       private static void OutPutCostMeth(int numberOfDrawers, string deskWoodType, int cost)

       {

           double totalCost = cost;

           Console.WriteLine("The number of drawers is {0}", numberOfDrawers);

           Console.WriteLine("The wood finish you have selected is ", deskWoodType);

           Console.WriteLine("The total cost is {0}", totalCost);

       }//end outputCost

   }//end class

}//end nameSpace

You might be interested in
n macOS, what launch point provides access to almost all the settings needed to administer a macOS system?
Fynjy0 [20]

Answer:

System preferences.

Explanation:

MacOS is the primary operating system designed and developed for Apple computers (MacBook).

In macOS, system preferences is a launch point that provides access to almost all the settings needed to administer a macOS system. The system preferences allow users to change various settings on their Mac computers such as changing the desktop layout, desktop picture (wallpaper), size and location of the dock, font size, appearance, energy saver etc.

5 0
2 years ago
In cell h15 enter a vlookup function to determine the 2018 percentage of total attendance for the city listed in cell h14. Use t
Amanda [17]

Answer:

=vlookup(h14, a5:h11,8,false)

Explanation:

Here, h15 is the cell in which we need the output and the value to be matched in rows to find the exact row is h14, and the range is expressed as a5:h11. Now to find the column number, we need to figure out the first and the concerned column. So, the concerned column is in which the total attendance is being listed and it is h(h14), and the first column is a. So, the column number is a=1 h=8, =8. And since we need the exact match, the value of the fourth argument is false. And thus, we have the above formula. Remember. vlookup formula is:

=vlookup(cell where the result is to be placed, range, column number in the same row as h14, exact match or approximate match). For exact match it's false, and for the approximate match, it's true.

8 0
3 years ago
Suppose that a company offers quantity discounts. If up to​ 1,000 units are​ purchased, the unit price is ​$1010​; if more than​
zhenek [66]

Answer:

Ans. Ready to download, please see the file attached to this document

Explanation:

Note. Consider changing the cell in yellow, does not make sense, it could be 10100 instead of 1010

Hi, to design this sheet, I also used the and(...) function of MS excel, in which you declate that in order to select a certain answer, 2 or more conditions must be true, in our case, if a purchase is up to 1000, the price would be $1010 (consider changing this value, maybe to 10100), if the purchase is more than 1000 and less than 5000, the price is $9,509.50, and if is more than 5000 units, the price would be $5,5005.50.

Please check the formula for further clarifications.

Best of luck.

Download xlsx
7 0
3 years ago
Technician A says that a system should be recharged with refrigerant until the condenser temperature is equal to the ambient tem
Reptile [31]

Answer:

Technician B

Explanation:

The vehicle will always come with a sticker placed under the hood of the AC unit. This sticker has information like the amount of ounces or pounds required for a complete charge. The car’s gauge will state the psi with most gauges having a color bar on the face the appropriate pressure.

6 0
3 years ago
In ip address 202.54.15.178, 15.178 is ______ address.
Tpy6a [65]

Answer:

Network address--An IP address with a host portion that is all zeros. Octet--An 8-bit number, 4 of which comprise a 32-bit IP address. They have a range of 00000000-11111111 that correspond to the decimal values 0-255. Packet--A unit of data passed over a TCP/IP network or wide area network.

7 0
2 years ago
Other questions:
  • Cloud resources are​ ________ because many different organizations use the same physical hardware.
    12·1 answer
  • In most software packages, the function key F1 is used to run the _____program.
    10·1 answer
  • Describe three perimeter intrusion detection systems and give an example of one that you have seen deployed either at work or an
    8·1 answer
  • Find the simple interest Jay owes on a five-year student loan of $48,000 with an annual interest rate of 5%.
    6·1 answer
  • MULTIPLE CHOICE QUESTION PLEASE HELP!!!!!!!!!
    14·2 answers
  • Why are computers useful for modeling situations?
    13·2 answers
  • What is net pay?<br> What is net pay?
    11·2 answers
  • What happens to a message when it is deleted?
    5·2 answers
  • First time using this site so be mindful if I make any mistakes
    6·1 answer
  • How does a security information and event management system (SIEM) in a SOC help the personnel fight against security threats
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!