Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Jimmy and Jenna want to start making 3D models of kitties to sell. They need a way to compute the selling price of the finished products. Your newfound C# knowledge of methods should be perfect for helping them. The model size can range from 2 to 10 inches, and the production cost is directly related to the model's size. The cost is computed as follows:

 

Size A 1.3 + 2 *Size + 5

 (for instance, a 3-inch kitty would cost 3 A 1.3 + 2* 3 + 5, or $15.17. They mark up their models by 50% when they sell them so that this 3-inch model would sell for $22.76. The program needs  to include THREE programmer-defined methods:

  • The first should be a type int method that reads the size of the kitty. Your method should restrict/limit the size to 2 to 10 inches, inclusive. Your method should prompt the user to enter a value and check it against the range allowed. If the value is acceptable, return it. Otherwise, keep prompting the user for values until they enter a valid measurement.
  • The second (ComputeCost) should accept an integer size for the kitty to be made and return the production cost.
  • The third method (ComputePrice) should accept the production cost returned from the first method and compute the selling price of the model.

Your output should be something like: Model Kitty - 3 inches - Cost: $15.17, Selling Price: $22. 76

Hint: use Math.Pow(a,b) to raise to compute a A b power.

CHALLENGE: Modify your ComputePrice method to round up so the price ends in .99, so for instance, the output from the above example would be: Model Kitty - 3 inches - Cost: $15. 74, Selling Price: $23.99

Expert Solution
Check Mark
Step 1: Introduction:

Below is the complete solution with explanation in detail for the given question about calculating cost and selling price of kitty based on size in CSharp programming language with sample output images.

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