The shape of a bottle is approximated by two cylinders of radius r1 and r2 and heights h1 and h2, joined by a cone section of height h3.
Using the formulas for the volume of a cylinder, V = πr2h, and a cone section,
develop pseudocode to compute the volume of the bottle. Using an actual bottle with known volume as a sample, make a hand calculation of your pseudocode.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Big Java Late Objects
Additional Engineering Textbook Solutions
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Absolute Java (6th Edition)
Database Concepts (7th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Java How To Program (Early Objects)
Data Mining for Business Analytics: Concepts, Techniques, and Applications with XLMiner
- Compute the approximate acceleration of gravity for an object above the earth's surface, assigning accel_gravity with the result. The expression for the acceleration of gravity is: (G * M) / (d 2), where G is the gravitational constant 6.673 x 10-11, M is the mass of the earth 5.98 x 1024 (in kg), and d is the distance in meters from the Earth's center (stored in variable dist_center).Sample output with input: 6.3782e6 (100 m above the Earth's surface at the equator)Acceleration of gravity: 9.81arrow_forwardCompute the approximate acceleration of gravity for an object above the earth's surface, assigning accel_gravity with the result. The expression for the acceleration of gravity is: (G * M) / (d 2), where G is the gravitational constant 6.673 x 10-11, M is the mass of the earth 5.98 x 1024 (in kg), and d is the distance in meters from the Earth's center (stored in variable dist_center).Sample output with input: 6.3782e6 (100 m above the Earth's surface at the equator)Acceleration of gravity: 9.81 G = 6.673e-11M = 5.98e24accel_gravity = 0.0 dist_center = float(input()) ''' Your solution goes here ''' print('Acceleration of gravity: {:.2f}'.format(accel_gravity))arrow_forwardAerospace engineers sometimes compute the trajectories of projectiles such as rockets. A related problem deals with the trajectory of a thrown ball. The trajectory of a thrown by a right fielder is defined by the (x,y) coordinates as displayed in the Figure below. Find the appropriate initial angle θ0 , if v0 = 30m/s, and the distance to the catcher is 90 m. Note that the throw leaves the right fielder’s hand at an elevation of 1.8 m and the catcher receives it at 1 m. Also, you have to write your Matlab code.arrow_forward
- Code in Matlab. Urgent Do itarrow_forwardThe Harris-Benedict equation estimates the number of calories your body needs to maintain your weight if you do no exercise. This is called your basal metabolic rate, or BMR. The calories needed for a woman to maintain her weight is: WBMR = 655 + (4.3 × weight in pounds) + (4.7 × height in inches) − (4.7× age in years) The calories needed for a man to maintain his weight is: MBMR = 66 + (6.3 × weight in pounds) + (12.9 × height in inches) − (6.8 × age in years) A typical chocolate bar will contain around 230 calories. Write a java program that allows the user to input his or her weight in pounds, height in inches, and age in years. The program should then output the number of chocolate bars that should be consumed to maintain one’s weight for both a woman and a man of the input weight, height, and age. NOTE: This is an application of a selection statement! Input Data: Use a named constant for the number of calories in a “typical chocolate bar.” Use Scanner methods to enter the…arrow_forwardCould you help me write a python code for this please: Apply the composite Trapezoidal rule to approximate the integral (integral shown below) N=10 rectangles. Calculate the absolute error using the exact integral 11/6. Repeat your calculation for N=10, 20, 30, 40, 50.arrow_forward
- Compute the average and print the standard deviation of four scores. The standard deviation is defined to be the square root of the average of four scores where a is the average of the four values (Si – a)2 where a is the average of the four scores of s1, s2, s3, and s4.arrow_forwardThe great circle distance is the distance betweentwo points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographicallatitude and longitude of two points. The great circle distance between the twopoints can be computed using the following formula:d = radius X arccos(sin (x1) X sin(x2) + cos(x1) X cos(x2) X cos(y1 - y2))Write a program that prompts the user to enter the latitude and longitude of twopoints on the earth in degrees and displays its great circle distance. The averageradius of the earth is 6,371.01 km. Note you need to convert the degrees into radiansusing the Math.toRadians method since the Java trigonometric methods useradians. The latitude and longitude degrees in the formula are for north and west.Use negative to indicate south and east degrees. Here is a sample run: Enter point 1 (latitude and longitude) in degrees: 39.55 −116.25 ↵EnterEnter point 2 (latitude and longitude) in degrees: 41.5 87.37 ↵EnterThe distance between the two points is…arrow_forwardDescription Xiao Zhang is often distressed because there are too many things to arrange. Now he has n tasks at hand, and each task has a starting times, and an ending time e;. To complete a task, he must do it from the starting time to the ending time, and Xiao Zhang can only perform one task at the same time. Xiao Zhang wants to know how many tasks he can accomplish at most. Input The first line is an integer n (1sns300000), indicating the number of tasks Xiao Zhang has at hand. In the next n lines, each line contains two integers s₁, e¡ (1≤s;arrow_forwardThe hexadecimal numeration system, used in computer programming, is a base sixteen system that uses the symbols 0, 1,2,3,4,5,6,7, 8,9, A, B, C, D, E, and F. Change the following hexadecimal numeral to a base ten numeral. 2CDExtenarrow_forwardQ10: Using (ode45, ode23, or ode15s), solve the below dynamic electrical system differential equation. 1. The charge Q(t) on the capacitor in the electrical circuit shown satisfies the differential equation where d²Q dQ 1 +R- + √ √e dt2 dt L = 0.5 R = 6.0 C= 0.02 and V(t) is the applied voltage. V(t) = V(t), henrys is the coil's inductance ohms is the resistor's resistance farads is the capacitor's capacitance ellee (i) Is the circuit oscillatory? (ii) If V(t) = 24 sin(10r) volts and Q(0) = 0 = Q'(0), find Q(t). (iii) Sketch the transient solution, the steady state solution, and the full solution Q(t).arrow_forwardAssignment Read a 3 digit number from one row, then a 1 digit number from the second row. Divide the 3 digit number over the 1 digit number. Show the process of division showing Quotient and Remainder throughout the process. Sample Input 123 3 Output Loay Alnaji 120/3 40 R 0 Sample Input 099 2 Output Loay Alnaji 099/2 44 R 11 11/25 R 1 (Stop when you have remainder less than the second input. So 1 is less than 2, so stop).arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning