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
weqwewe [10]
3 years ago
13

A. Create a console-based application named Desks that computes the price of a desk and whose Main() method calls the following

methods:
• A method to accept the number of drawers in the desk as input from the keyboard. This method returns the number of drawers to the Main() method.
• A method to accept as 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:
• Pine desks are $100.
• Oak desks are $140.
• All other woods are $180.
• A $30 surcharge is added for each drawer.
• This method returns the cost to the Main() method.
• A method to display all the details and the final price.
b. Create a GUI application named DesksGUI that accepts desk order data from TextBox
Computers and Technology
1 answer:
Maslowich3 years ago
4 0

Answer:

Explanation:

Code:-

using System;

using System.Linq;

using System.Collections;

using System.Collections.Generic;

public class Test{

public static int no_drawer(){

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

return Int32.Parse(Console.ReadLine());

}

public static char wood_type(){

Console.WriteLine("Enter the type of woods('m' for mahogany, 'o' for oak, or 'p' for pine) : ");

return Console.ReadLine()[0];

}

public static double final_cost(int d,char ch){

double cost = 0.0;

if (ch == 'p') cost += d*100;

else if (ch == 'o') cost += d*140;

else cost += d*180;

cost += d*30;

return cost;

}

public static void display(int d,char ch,double p){

Console.WriteLine("Number of drawers : "+d);

if (ch == 'p')

Console.WriteLine("Type of Wood Chosen : pine");

else if (ch == '0')

Console.WriteLine("Type of Wood Chosen : oak");

else if (ch == 'm')

Console.WriteLine("Type of Wood Chosen : mahogany");

else

Console.WriteLine("Type of Wood Chosen : other");

Console.WriteLine("Total Cost is : "+p);

}

public static void Main(){

int drawers = no_drawer();

char ch_wood = wood_type();

double res = final_cost(drawers,ch_wood);

display(drawers, ch_wood,res);

}

}

cheers i hope this helped !!!

You might be interested in
In electrical work, resistance is often represented by thea. Greek symbol O.
Elanso [62]

Resistance is often represented by Ω, (pronounced Ohm). The symbol itself is actually omega though, which is the Greek symbol for O.

So your answer is a.

3 0
3 years ago
Several steps are involved in creating a presentation. What is the last step in the process before preparing to present it?
kupik [55]
The answer to this is B.
8 0
3 years ago
Read 2 more answers
What is the difference between Windows 7 and Windows 10?
Tanzania [10]
Windows 10 is new and windows 7 is old
6 0
3 years ago
What would be the result of sending the string AAAAAAAAAAAAAAAAAAAA into a variable that has allocated space for 8 bytes
DerKrebs [107]

The result of sending the string above into a variable that has allocated space for 8 bytes is that there will be Buffer Overflow Attacks.

<h3>What occurs when a string of data  sent to buffer is large?</h3>

A buffer overflow is also known as buffer overrun. This  is known to be a process that occurs when or if  the size of data is known to be more than the storage capacity of any kind of memory buffer.

Note that due to the overload, the program that is trying to write the data to the buffer will therefore overwrites to the adjacent memory locations.

Learn more about string from

brainly.com/question/26427527

4 0
3 years ago
In Scratch, you have to choose backdrops from a limited number in the Scratch image library.
forsale [732]
I would say it would be True
5 0
3 years ago
Other questions:
  • What is an example of asynchronous communication
    7·1 answer
  • Which of the following statements is​ FALSE? A. Security is a huge concern for nearly all organizations with private or propriet
    14·1 answer
  • in some caes before carrying out a command a program may ask you to provide may ask you to provide more information or to make a
    6·1 answer
  • Meadowdale Dairy Farm sells organic brown eggs to local customers. It charges $3.25 for a dozen eggs, or 45 cents for individual
    6·1 answer
  • (Display nonduplicate words in ascending order)
    11·1 answer
  • If your DTP document contains watermarks on every page, where can you place them?
    10·1 answer
  • Why use LinkedIn Sales Navigator?
    5·1 answer
  • Comparing tools made of stone, iron, and bronze: place them in the correct order from least to most durable.
    5·1 answer
  • Study the original and changed passages.
    8·2 answers
  • Задание: Построить иерархию классов в соответствии с вариантом задания. Построить диаграммы классов.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!