You are cutting off a piece of pie like this, where c is the length of the straight part (called the chord length) and h is the height of the piece.
There is an approximate formula for the area:
However, h is not so easy to measure, whereas the diameter d of a pie is usually well-known. Calculate the area where the diameter of the pie is 12 inches and the chord length of the segment is 10 inches. Generalize to an
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Big Java Late Objects
Additional Engineering Textbook Solutions
Starting Out with Java: Early Objects (6th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Concepts of Programming Languages (11th Edition)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Problem Solving with C++ (10th Edition)
- With a fancy calculator, finding square roots is easy. But what if you only had a basic four-function calculator? Assuming that number holds the value that you want to calculate the square root of, the following algorithm approximates the square root of a number: Get a guess from a human Square the guess If the squared guess is within 0.1 of the original number, we will accept the guess as our answer If it is not, try again with a different guess and keep trying until we get an answer that is close enough This algorithm relies on a human to make the guesses, though it wouldn't be too hard to also design an algorithm for making an appropriate guess. What would be a flowchart for this?arrow_forwardPython This simulates the population of fish. Use this to generate a plot with a numerical solution and the exact solution on the same plot axes for model parameters, P_m = 20,000 fish with a birth rate of b=6%, a harvesting rate of h=4%, a change in t=0.5 and y_0=5000arrow_forwardWrite a computer program to compute the final value of A, B AND F with keep the same arrangement. The initial value ofA = 2.5, I = 1, B = 3.2arrow_forward
- CThere is a road, the starting coordinate is 0, and the coordinatesof the line are given to draw a black line, for example, five linesegments for drawing black lines, (5, 6), (1, 2), (4, 8), (7 , 9)and (5, 8), as shown belowOutput:Length of the black line on the road: 6Maximum number of overlaps: 3Maximum number of overlaps Length of black line: 2 The first row is a positive integer N, there are N line segments for drawing black lines.Then there are the integer values of the start point coordinates and the end point coordinates of the line segment of the black line. Sample 15160 180150 200280 300290 330190 210Output:Length of the black line on the road: 110Maximum number of overlaps: 2Maximum number of overlaps Length of black line: 40 Sample 21120 120Output:Length of the black line on the road: 0Maximum number of overlaps: 0Maximum number of overlaps Length of black line: 0arrow_forwardWrite a program to calculate the surface area and volume of a square pyramid. A square pyramid has a base that is square and all triangle faces are congruent isosceles triangles. (An isosceles triangle is a triangle in which two of the sides are equal. Length of the base: a Height of the pyramid: h Volume = a2h/3 Slant height, s = sqrt(h2 + (a/2)2) This is the Pythagorean Theorem part. Area of one pyramid side = s*a/2 Test Case #1 Height(h): 5.0’ Base(a): 2.5’arrow_forwardLet l be a line in the x-yplane. If l is a vertical line, its equation is x = a for some real number a. Suppose l is not a vertical line and its slope is m. Then the equation of l is y = mx + b, where b is the y-intercept. If l passes through the point (x₀, y₀), the equation of l can be written as y - y₀ = m(x - x₀). If (x₁, y₁) and (x₂, y₂) are two points in the x-y plane and x₁ ≠ x₂, the slope of line passing through these points is m = (y₂ - y₁)/(x₂ - x₁). Instructions Write a program that prompts the user for two points in the x-y plane. Input should be entered in the following order: Input x₁ Input y₁ Input x₂arrow_forward
- A very known application in natural language processing is to extract information from a given text. In this lab, you will be able to extract some emotions (Sad and Happy) from a given string and calculate the score of each emotion. You will be given below the words that express sadness, anger, and happiness. For each word, you will be given weight as well, so that when you are calculating for example the score for sadness in the text (string), you can use this formula:arrow_forwardWrite a program that produces a multiplication table, showing the results of multiplying the integers 1 through 12 by themselves.arrow_forwardSuppose you save $100 each month in a savings account with annual interest rate 3.75%. Thus, the monthly interest rate is 0.0375/12 = 0.003125. After the first month, the value in the account becomes 100 * (1 + 0.003125) = 100.3125, after the second month, the value in the account becomes (100 + 100.3125) * (1 + 0.003125) = 200.938, after the third month, the value in the account becomes (100 + 200.938) * (1 + 0.003125) = 301.878 and so on. Write a Java program that prompts the user to enter a monthly saving amount and displays the account value after the sixth month. (You will use a loop to simplify the code and display the account value for any month.) Sample Output:Enter the monthly saving amount: 100After the first month, the account value is 100.3125After the second month, the account value is 200.9384765625After the third month, the account value is 301.8789093017578Note: The computation should be until 12 months.arrow_forward
- Give English language translations of the following wffs where L(x, y) is “x loves y”, H(x) is “x ishandsome”, M(x) is “x is a man”, P(x) is “x is pretty”, W(x) is “x is a woman”, k is “Kathy”, andj is “John”.(a) (∀x)(W(x) → (∀y)[L(x, y) → M(y) ∧ H(y)])(b) (∃x)[M(x) ∧ H(x) ∧ L(x, k)](c) (∃x)(W(x) ∧ P(x) ∧ (∀y)[L(x, y) → H(y) ∧ M(y)]) (d) (∀x)[W(x) ∧ P(x) → L(j, x)]arrow_forwardYou are given a grid of size n ×m and within that grid there is a horizontal rod (arbitrary widthbut height of 1). You aim is to locate it. The only thing you can use to find the location of the rod is makequeries of the form IsPresent (x1, y1, x2, y2) where x1 ≤x2, y1 ≤y2. This returns True if part of the rod ispresent in the grid from (x1, y1) to (x2, y2) and False if not. See figures below. Design an algorithm whichuses queries O(log(n +m)) times to find the location of the rod, i.e., the leftmost coordinates and rightmostcoordinates. Hint: consider using binary search in your algorithm.arrow_forwardIn the real world, functions are mathematical representations of input-output situations. A vending machine is one such example. The input is the money combined with the selected button. The output is the product. Here is another example: The formula for converting a temperature from Fahrenheit to Celsius is a function expressed as: C = (5/9)*(F - 32), where F is the Fahrenheit temperature and C is the Celsius temperature. If it is 77 degrees Fahrenheit in Phoenix Arizona, then what is the equivalent temperature on the Celsius thermometer? Our input is 77. C = (5/9)*(77 - 32) C = (5/9)*(45) C = 25 The equivalent temperature is 25 degrees Celsius. To complete the Discussion activity, please do the following: Choose your own function or choose from the list below and then provide a unique example of a function and evaluate the function for a specific input (like the example above). Arm length is a function of height. The circumference of a circle is a function of diameter. The height of…arrow_forward
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole