Create an application named Tables that computes the price of a table and chairs and whose Main() method calls the following methods: A method to accept the number of chairs to go with the table as input from the keyboard. This method returns the number of chairs to the Main() method. A method to accept as input and return the type of wood: p for pine, m for maple, and o or oak (use a loop to ensure only one of these letters is entered).  A method that accepts the number of chairs and wood type, and calculates the total cost of the desk based on the prices below. This method returns the total cost to the Main() method. Pine tables are $250. Maple tables are $300. All other wood types are $350. There will be an additional cost of $50 per chair. A minimum of 2 chair must be ordered (use a loop to ensure a value of 2 or more is entered.) A final method to display all the details and the final price. The image below shows a sample run of the program.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Create an application named Tables that computes the price of a table and chairs and whose Main() method calls the following methods:

  1. A method to accept the number of chairs to go with the table as input from the keyboard. This method returns the number of chairs to the Main() method.
  2. A method to accept as input and return the type of wood: p for pine, m for maple, and o or oak (use a loop to ensure only one of these letters is entered). 
  3. A method that accepts the number of chairs and wood type, and calculates the total cost of the desk based on the prices below. This method returns the total cost to the Main() method.
    • Pine tables are $250.
    • Maple tables are $300.
    • All other wood types are $350.
    • There will be an additional cost of $50 per chair. A minimum of 2 chair must be ordered (use a loop to ensure a value of 2 or more is entered.)
  4. A final method to display all the details and the final price.
  5. The image below shows a sample run of the program.
C:\C#>Tables.exe
Enter number of chairs >> 1
You must order at least two chairs.
Enter number of chairs >> 2
Enter type of wood - p, m or o >> r
You have entered an invalid wood type.
Enter type of wood - p, m or o >> t
You have entered an invalid wood type.
Enter type of wood - p, m or o >> m
You have ordered a maple table with 2 chairs
Total price is $400.00
Transcribed Image Text:C:\C#>Tables.exe Enter number of chairs >> 1 You must order at least two chairs. Enter number of chairs >> 2 Enter type of wood - p, m or o >> r You have entered an invalid wood type. Enter type of wood - p, m or o >> t You have entered an invalid wood type. Enter type of wood - p, m or o >> m You have ordered a maple table with 2 chairs Total price is $400.00
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage