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
When using the following symbol, there are two arrows coming out of it. One arrow corresponds to what happens in the program if
mariarad [96]

When using the following symbol, there are two arrows coming out of it. One arrow corresponds to what happens in the program if the answer to the question if it is _______YES_____ and the other corresponds to what happens next if the answer to the question is _____NO_____ .

Explanation:

When using the following symbol, there are two arrows coming out of it. One arrow corresponds to what happens in the program if the answer to the question if it is <u>Yes and the other corresponds to what happens next if the answer to the question is No.  </u>

The Below symbol(in attachment ) is used to take decisions. This decision taking step is represented as a diamond in a flowchart.

8 0
2 years ago
Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author'
lbvjy [14]

Answer:

Check the explanation

Explanation:

Pseudocode For Reading File:

start

Declarations

InputFIle records.txt

OutputFile result.txt

string authorName

string title

int numOfVol

open InputFile

open OutputFile

input authorName, title, numOfVol from records.txt

while not eof

output authorName

output title

output numOfVol

end while

close records.txt

close results.txt

END

The flowchart for reading the file can be seen below.

3 0
3 years ago
Ncomputing and thin client<br>what it is <br>why is done , how it works and how it's <br> done ​
SVEN [57.7K]

The term NComputing  is known to be a form of desktop virtualization company that is said to creates hardware and software to form virtual desktops.

The term Thin clients is known to be virtual desktops. They help a lot of users at the same time to share a single operating system instance.

<h3>What is the aim of a thin client?</h3>

In Ncomputer networking, a thin client is known to be a kind of low-performance computer that is known to be optimized and used for setting up a remote connection.

It is often used with a server-based computing system. The server here is one that often does most of the work, such as launching software programs, etc.

Learn more about Ncomputing from

brainly.com/question/12629145

4 0
2 years ago
Explain the characteristics of 1st generation computers​
levacccp [35]

Explanation:

i hope this is the right answer

!st generation computers were more big and bulky and you for sure could not bring them around everywhere.

8 0
3 years ago
List pros and cons of HCI technology​
Verdich [7]
A pro of HCI technology is that its user friendly and a con about it is that you have to teach the user what to do or guide them!
8 0
2 years ago
Read 2 more answers
Other questions:
  • ______________ is only one of the marketing mix tools that acompany uses to achieve its marketing objectives.
    7·1 answer
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
  • What is the Documenter?
    10·1 answer
  • 20 points
    6·2 answers
  • If you go over 255 in RGB by 1 does it reset to 0 or 1
    11·1 answer
  • Write a program that asks the user to enter two integer numbers X and Y. The program halves each number between X and Y then pri
    15·1 answer
  • 1. select the correct answer from the given options.
    5·1 answer
  • My father helps me more than helping my sister in Maths because I need more help to understand. This situation shows ___________
    11·1 answer
  • it is good to know and use the npsd framework while solution envisioning as part of the value discovery cycle. What is NPSD?
    10·1 answer
  • 9.2 lesson practice ​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!