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
What is presentation
Gelneren [198K]
To present something infront of a crowd
5 0
2 years ago
Read 2 more answers
How the data is converted into the information?​
leonid [27]

Answer:

the data is converted into information by data processing

7 0
3 years ago
Read 2 more answers
WILL UPVOTE ALL plz
evablogger [386]
Ash is the answer. Hope this helps
4 0
3 years ago
Match the order in which you should develop a plan:
Advocard [28]

Develop

Present

Approve

Brainliiest please?

4 0
2 years ago
Asymmetric key encryption combined with the information provided by a. certificate authority allows unique identification of the
Nesterboy [21]

Answer:

c. both the user and the provider of encrypted data.

Explanation:

In assymetric key encryption, you will need the public key of the sender to decode the information along with your private key to decode the encrypted information. if you don't have any of the keys, you won't be able to read the information. You must have both in order to read the information sent.

5 0
2 years ago
Other questions:
  • What’s a sign you should talk to an adult about your online time
    14·2 answers
  • How do you make your graphics ADA accessible in BlueGriffon?
    12·2 answers
  • Which of the following code segments does not contain any errors?
    7·1 answer
  • Multiply 1101 and 0110 in binary.
    10·1 answer
  • When a formula contains the address of a cell, it is called a(n) ________.
    15·1 answer
  • What is the term for a Web site that allows users to access and interact with software from any Internet-connected computer or d
    11·1 answer
  • If your computer won't connect to the internet, which of these is most likely to be the problem?
    8·1 answer
  • If you are running a server , which of the follow operating system would be best suited ?window 10 or macOS
    8·1 answer
  • Delete temp or %temp% files in Windows 10 is safe and, can it help boost up your PC fps?
    5·1 answer
  • How to write the algorithm to calculate the square of five numbers
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!