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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education