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
- 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
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.
Step by stepSolved in 3 steps with 2 images
- Starting Out with Java From Control Structures through Objects 6th Edition Paint Job Estimatorarrow_forwardSuppose you are a computer salesman and your income depend on the total sales and commissions earned for the computers that you sell. Commission rates vary depending on how many units you sold (see chart below). Your income equals to the total sales plus the commission where the commission equals to total sales times the commission rate. That is, commission = total sales * commission rate and income = total sales + commission. Total Sales Commission rate % Less than 200 sold 8% (totalsales < 200) Greater or equal to 200 sold 10% (totalsales >=200 & totalsales <400) Greater than to 400 sold 12% (if (totalsales >= 400) Use Multiway if, else if (use as many you need) and else correctly Review slides 3-CH-2 Slide 4 and 8 Write the code correctly as show in the chapter slides. Pay attention to the commission chart above: (3) input as examples shown 500, 250, 150 You can work with your team and submit your code and output in PDF. 1. Provide the user the commission rate list…arrow_forwardPlease written by computer source Please solve with C - NIM Gamearrow_forward
- In Java In designing a building, structural engineers must determine whether each of thebuilding’s support columns is thick enough to support the column’s expected load.Assume the column is wooden and has a solid square cross section. To be safe, allthree of these conditions must be met:• The column should not be too slender, that is:height / width ≤ 50, where 50 is a special value called the slendernesslimit.• To prevent the column from buckling, make sure this requirement ismet:expected load ≤ (0.3*E*area) / (height/width)2,where E = 1,700,000 psi is a special value called the modulus ofelasticity.• To prevent the column from compressing, make sure this requirementis met:expected load ≤ area * stress,where stress = 1450 psi = maximum allowable stress parallel to thegrain.Write a program that determines whether a wooden column with a given height isthick enough to support a given expected load. More specifically, read in height,width, and expected load values and then print, “The…arrow_forwardYou are hired by a game design company and one of their most popular games is The Journey. The game has a ton of quests, and for a player to win, the player must finish all the quests. There are a total of N quests in the game. Here is how the game works: the player can arbitrarily pick one of the N quests to start from. Once the player completes a quest, they unlock some other quests. The player can then choose one of the unlocked quests and complete it, and so on. For instance, let’s say that this game had only 4 quests: A, B, C, and D. Let’s say that after you complete • quest A, you unlock quests [B, D]. • quest B, you unlock quests [C, D]. • quest C, you unlock nothing [ ]. • quest D, you unlock quest [C]. Is this game winnable? Yes, because of the following scenario: The player picks quest A to start with. At the end of the quest A, the unlocked list contains [B, D]. Say that player chooses to do quest B, then the…arrow_forwardData Generator Most application depends on data. In IoT data is collected/generate by sensors. Since, we do not have access to sensors, we will have to generate data via code. The plotting a sufficient number of these data points (500 in this case) should get the following diagram or something very similar: You will pick a quantity that you would like to simulate (such as temperature, humidity, barometric pressure, customers arriving at a mall, or just with an alternate descriptor) and decide what shape you will emulate. This will guide you in selecting sensible value base lines for your data values. e.g., If you pick inside temperature then normal range will be 18-21oC. Design and build a class that will model your sensor reasonably well. Notice how the peaks do not occur at regular interval, nor are they the same height. Even the squiggles are the same shapes. You will create a class with a single public member (property) that give you a “random” value in your intended range and…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education