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

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

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
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.

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
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