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.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_forwardModify the given code snippet (Ohm’s.py) and this time solve for the Resistance. Follow this pseudo code: (Use Phyton Program) Give the user Ask the user for voltage in Ask the user for the current in Compute the voltage from R=V/I. Print out the resulting Resistance inarrow_forwardFor arbitrary a and b,c % m = (a b) % mc % m = [(a % m) (b % m)] % mUsing this mathematical property, you can iterate 1 to the exponent, recalculating each time by multiplying the current modulus value with the last.Here is the pseudocode:1 Set value = 1, current exponent = 0.2 Increment current exponent by 1.3 Set value = (base value) mod modulus until current exponent is reached exponentExample: Base: 4, Exponent: 3, Modulus: 54ˆ3 % 5 = 64 % 5 = 4value = (lastValue x base ) % modulus:value = (1 x 4) % 5 = 4 % 5 = 4value = (4 x 4) % 5 = 16 % 5 = 1value = (1 x 4) % 5 = 4 % 5 = 4write javascript code ?arrow_forward
- Description 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_forwardWrite a program to calculate standard daviationarrow_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_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_forwardCode in Python. Find the smallest positive root of the equation f(x) = 2x − tg(x) with error less than 0.01arrow_forwardThe pseudocode for implementing the Taylor series expansion is shown below. The pseudocode is designed to return the value of the value of e* correct to two decimal places. This also requires the use of the factorial function created in the previous section. INPUT x, OUTPUT ExpVal % Initial computation n- 0, xold - 0 xnew - xold + (x^n)/nl error = |xnew - xold| xold = xnew n-1 %Successive computations WHILE error 2 0.001 xnew - xold + (x^n)/nl error |xnew - xold xold - xnew n=n+1 END WHILE ExpVal = xnew Question 10: Write a script taylor.m that computes the value of the function e* for a given user input x. Provide La proof that your script works.arrow_forwardWrite Pseudocode to find the result of equationarrow_forwardGiven a sequence of N input number variables, where itself is an input variable number, write predocode for a program that first checksif N is greater than zero and then goes on to output the minimum of the N input numberarrow_forwardGiven Sphere_radius and pi, compute the volume of a sphere and assign it to sphere_volume Use (4 0 / 3 0) to perform floating-point division, instead of (4 / 3) which performs the integer version. The volume of sphere = (4.0 /10) pi.r2 sample output for the given program is 9.803495445209855arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- 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