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
A heart murmur is caused by incorrect operation of ________?​
Levart [38]

Answer:

the valves

Explanation:

science explains your questions answer. also did you know that the queen was an engineer in WWII? you probably did but you need 20 characters to submit an answere trust me it is the valves.

6 0
3 years ago
You can edit existing conditional formatting _____ from the conditional formatting rules manager dialog box.
Lera25 [3.4K]
I believe the term you're looking for would be "rules" 
send me a message if not true.
7 0
3 years ago
A word or line of a paragraph at the bottom of the page indent is called _______
sashaice [31]

Answer:

Orphan

Explanation:

                               Orphan may be defined as the term given to a word or a line of a paragraph that is alone at the bottom of a page .

                              It is a  paragraph-opening sentence or word appearing  at the bottom of a column or page by itself,and it remain separated from the remaining text or paragraph.

                              Orphans and widows are not desirable and must be avoided while writing text.

Thus the answer is Orphan.

5 0
3 years ago
Read 2 more answers
Write your own Python or Perl script that carries out Base64 encoding. If you use the BitVector module, your solution should not
slavikrds [6]

Answer:

SORRRY IDK PLZ DONT JUDGE ME

Explanation:

3 0
3 years ago
The OneDrive for Business application opens every time you start your program. You want to stop the program from automatically s
densk [106]

Answer:

Using the Task Manager to disable the OneDrive startup program.

Explanation:

To stop OneDrive for Business application from opening every time you start your computer you can use task Manager to disable the OneDrive startup program.

This can be achieved by:

  • Press Ctrl+Shift+Esc keys together to open Task Manager. You can also open it by right-click on Taskbar and select Task Manager option.
  • Now go to "Startup" tab in Task Manager, select "Microsoft OneDrive" item given in the list and click on "Disable" button.
  • That's it. Restart your computer and OneDrive will no longer start with Windows.
4 0
3 years ago
Other questions:
  • Erica has always selected large numbers of cells by clicking and dragging her mouse. A shortcut that she could use is to select
    6·1 answer
  • _________ is critical to Amazon's success.<br><br> SCM<br><br> JIT<br><br> ERP<br><br> VMI
    9·1 answer
  • Harmful programs used to disrupt computer operation, gather sensitive information, or gain unauthorized access to computer syste
    10·1 answer
  • If Word finds a potential error in a document, a red, green, or blue wavy underline flags the problem.
    14·1 answer
  • Some of the users in your company create and delete so many files that they have problems with fragmented disks. Which of the fo
    5·1 answer
  • • Suppose an application generates chunks of 40 bytes of data every 20 msec, and each chunk gets encapsulated in a TCP segment a
    5·1 answer
  • What are the three uses of a screw?​
    13·2 answers
  • For all of you who listen to podcasts, when do you usually find time to do so?​
    13·1 answer
  • Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
    14·1 answer
  • Select all correct statements below: Group of answer choices A redundant link's switch port will be blocked by STP until needed.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!