Advertisement

3- Freudian Sip e coffee and are on a tight budget- you certainly want.docx

todd621
Feb. 8, 2023
3- Freudian Sip e coffee and are on a tight budget- you certainly want.docx
3- Freudian Sip e coffee and are on a tight budget- you certainly want.docx
Upcoming SlideShare
Chapter 2.1Chapter 2.1
Loading in ... 3
1 of 2
Advertisement

More Related Content

More from todd621(20)

Advertisement

3- Freudian Sip e coffee and are on a tight budget- you certainly want.docx

  1. 3: Freudian Sip e coffee and are on a tight budget, you certainly want to be sure you get your money's worth. You like cream in your coffee, but you realized that asking for "no room" means that you also get less coffee, the barrista will leave enough room in the cup for you to add your cream. So you wonder how much you lose when you ask for "room". answer that question, you measured the geometry of a small Freudian Sip coffee cup, and then gathered some drta on how the cup was filled with "room" versus "no room". You asked for 5 small coffees "with room" and with room, and measured the depth of the liquid, measuring along the side of the cup (d'). You will create an application (user interface worksheet and main Sub procedure) to analyze data. d (mm) with room no room Top rim of cup 22 Rt 4.0 cm Rb 3.2 cm H 4.2 cm Averages: Fluid bottom of cup lost with room the User create output cells the average with your liquid depth measurements. Enter the input data shown. Create the three for depths and percentage of lost coffee for pours with "no room". Using your geometry reference book, you looked up the formula for calculating the volume of a right circular cone section: Hints: 1) Let e s cup cone angle from vertical, then tan(6) (R Rb)/H 2) Let Rrs the fluid level radius, then sin(6) (Rt Rr)/d. Write a Sub procedure that does the following: a. Reads the cup geometry into procedure variables, and the fluid depth measurements into a two-dimensional static array. b. Calculates the average depths for "with room" and for "no room", and write the results to the output cells. c. Calculates the volume of coffee for each case, storing these results in procedure variables. d. Calculates and writes out the percent of coffee lost for the "with room" case, relative to the "no room case. Solution public class MyCylinder 03 { 04 Â Â Â Â public static void main (String[] args) 05 Â Â Â Â { 06 Â Â Â Â Â Â Â Â double radius = Double.parseDouble(JOptionPane.showInputDialog(null,"enter radius")); 07 Â Â Â Â Â Â Â Â double Length = 1; 08 Â Â Â Â Â Â Â Â double volume = Math.PI * radius * radius * Length; 09 Â Â Â Â Â Â Â Â System.out.println("volume " + volume); 10 Â Â Â Â Â Â Â Â Â 11 Â Â Â Â } 12 }
Advertisement