Create a class ShapeProcessor containing the following stati…
Create a class ShapeProcessor containing the following static method: static Set processShapes(String filename). The method reads the description of shapes from a text file, creates the corresponding Shape objects, stores them in a Set, and returns the completed set. The order of the shapes in the set doesn’t matter. Each line of the input file describes one shape and has one of the following formats: R, x, y, w, hT, x1, y1, x2, y2, x3, y3 where R indicates a rectangle whose lower-left corner is (x, y) with width w and height h. T indicates a triangle whose vertices are (x1, y1), (x2, y2), and (x3, y3). You can assume that the file is well-formed, i.e. the values in a line are separated by , first column of each line determines the type of shape. remaining values should be interpreted based upon the first letter lines starting with the letter R have exactly 5 values (including R) lines starting with the letter T have exactly 7 values (including T) The method should: Read the input file one line at a time Determine the type of shape from the first column Parse the remaining values Create the appropriate Rectangle or Triangle object Store each shape in a Set Handle any relevant exceptions Return the completed set.
Read DetailsReading material Select and answer only one from the followi…
Reading material Select and answer only one from the following: What is the proposed solution housing shortages? Which state is considering this strategy? Would you say that you think like an economist? What are some examples given that show most people do not think like economists? What was the major obstacle that led to the pharmaceutical factory to shut down? How have sportswear manufacturers responded to changes in consumer preferences? Is it easier or more difficult for competitors to create a substitute? Why? Your response should be several sentences long and include key points made in the article.
Read DetailsNonlinear Spring Oscillator PHY 2048C Cumulative Final Exami…
Nonlinear Spring Oscillator PHY 2048C Cumulative Final Examination Points: 10 Suggested Time: 25–30 minutes Instructions: Show all work. Begin each derivation with an appropriate fundamental physics principle. Clearly define any additional symbols you introduce. Unsupported answers may not receive full credit. A cart of mass m moves without friction along a horizontal track. It is attached to a nonlinear spring whose restoring force is Fs(x) = −k0x(1 + αx) where x is measured from equilibrium, k0 > 0, and α is a constant with units of inverse length. The cart is released from rest at x = A, where 1 + αx remains positive over the entire motion. Tasks Part A. Derive the spring potential-energy function U(x), choosing U(0) = 0. Part B. Derive the speed of the cart as a function of position, v(x), while it moves from x = A toward equilibrium. Part C. Determine the cart’s speed as it passes through x = 0. Part D. Write, but do not evaluate, a definite integral that gives the time required for the cart to move from x = A to x = 0. Part E. Linearize the equation of motion for sufficiently small displacement and determine the corresponding small-amplitude angular frequency ω0. Part F. Determine the magnitude of the cart’s acceleration at the instant it is released. State how this compares with the acceleration predicted by the small-amplitude model.
Read Details