Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I just want some explanation on how I would go about solving this problem. What

ID: 3886163 • Letter: I

Question

I just want some explanation on how I would go about solving this problem. What fourmula I should use? IS 1300 HWK 2 Fall 2017 You have $s with a height of 6 inches and a diameter of 3 inches is $3.75+tax. The cost o in a cylinder shaped cup f the same soft drink in a cone wi Tax is 8%. what shaped? You MUSTrel item. e shaped cup with a height of 6.5 inches and a diameter of 3 inches is $3.75+tax. is the total cost and which should you buy, the cone shaped or the cylinder od aulso MUST include code to show if you do not have enough money to buy the Use the data above as test data but the user could use other data as input. You MUST use Math.pow You MUST use printf Some formulas you MAY want to know. Area ofa cylinder-omrh + ,2 Volume ofa cylinderAh Are of acone-n-r(rt ) Volume ofa cones y's _h Are ofa cube a z Volume ofa cube-83 Input and output should be as below: rosoft Corporation. rights reserve :Users ic 181>color fB c users' nele1>cd desktop CUsersnc 181 Desktop>javac H2.java C:NUsersvnc 181 Desktop>java H2 5.80 Enter anount of noney you have enter cost of iten 75 nter dianeter of cylinder Enter height of cylinder Enter dianeter of cone Enter height of cone 6.5 You should buy he total cost due is., 4.es cylinder shape since it is 22.08 inches bigger

Explanation / Answer

Here you have to find out that which is better to purchase either cylindrical shaped cup for cold drink or cone shaped..

To do so you should look for which can have more quantity as the price is same for given heights and diameters.

So for calculating quantity you should use volume formula of both shapes, also you have to calculate the cost with tax that whether with that amout is it possible to purchase.

To calculate the price say for given parameter cost = $3.75 + tax, tax = 8% therefore tax = 8% of 3.75 = 0.3, now price = 3.75 + 0.3 = 4.05.

Now if you have $5 you can purchase the cup of given heights and diameters, but which one is more profitable to purchase, to find that we calculate the volume of both as:-

cylinder cup volume = 22/7 * (1.5)^2 * 6 {diameter = 3 , therefore radius = diameter/2 = 1.5}

= 42.42

cone cup volume = 1/3 (22/7 * (1.5)^2 * 6.5

= 15.32

As per the answer buying of cylinder cup is much more beneficial than that of cone since cone is 27 units less than the cylinder cup.

Here to square the radius you must use math.pow as [rr = math.pow(r, 2)].

To print the result use printf("");