3. Please further expand the function you implemented in (2) to allow the printing of the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. Please further expand the function you implemented in (2) to allow the printing of the number of each unique "leaf part" in a sub-parts-structure tree as the example shown below: (20 points) P3 P6 378 P7 32 9 P5 3 P6 2 P1 P3 9 3 P5 3 P6 P2 P4 8 P7 = In this example, given the part 'P1' and its sub-parts-structure tree, there are 2*9*3+4*3*9*3 = 378 'P6' parts and 4*1*8=32 'P7' parts. Therefore, given input value 'P1', the function should print out the following (you need to create a table with the data above to test your code): 4. Implement the above two functions in PL/PGSQL. (22 points) See Appendix for PL/PGSQL tutorial. 5. Write a Java Program to simulate an interactive SQL interface like psql. It should allow the user to query and update the tables in the database. Make sure your program prints out the query result (with column headings) or the update status (e.g., the number of rows deleted/updated/inserted) (10 points) 6. (Bonus) Write a Java program to simulate a student information query interface where input can be provided for one or more of the following fields: student name, and/or student number, and/or DoB. Assume information about students are stored in a table Students(Snumber, Sname, DoB). The output should be all the qualified student records. A graphical user interface is NOT required. (8 points, no partial credits will be awarded. Hint: Dynamic SQL) 3. Please further expand the function you implemented in (2) to allow the printing of the number of each unique "leaf part" in a sub-parts-structure tree as the example shown below: (20 points) P3 P6 378 P7 32 9 P5 3 P6 2 P1 P3 9 3 P5 3 P6 P2 P4 8 P7 = In this example, given the part 'P1' and its sub-parts-structure tree, there are 2*9*3+4*3*9*3 = 378 'P6' parts and 4*1*8=32 'P7' parts. Therefore, given input value 'P1', the function should print out the following (you need to create a table with the data above to test your code): 4. Implement the above two functions in PL/PGSQL. (22 points) See Appendix for PL/PGSQL tutorial. 5. Write a Java Program to simulate an interactive SQL interface like psql. It should allow the user to query and update the tables in the database. Make sure your program prints out the query result (with column headings) or the update status (e.g., the number of rows deleted/updated/inserted) (10 points) 6. (Bonus) Write a Java program to simulate a student information query interface where input can be provided for one or more of the following fields: student name, and/or student number, and/or DoB. Assume information about students are stored in a table Students(Snumber, Sname, DoB). The output should be all the qualified student records. A graphical user interface is NOT required. (8 points, no partial credits will be awarded. Hint: Dynamic SQL)
Expert Answer:
Answer rating: 100% (QA)
To further expand the function from 2 to count the number of each unique leaf part in a subpartsstructure tree you can modify the function to store the counts of each part in a dictionary or map Heres ... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these computer network questions
-
Describe the service-product bundle for each of the following services: a. Hospital b. Lawyer c. Trucking firm
-
Describe a synthesis for each of the following compounds, using the given starting material and any necessary reagents: a. b. CH3CH2CH2CHCH3 Br CH,-CH-CH-CH2
-
Include a response for each of the following in your paper: Evaluate changing theories and practices in business and their potential, positive impact on society. Describe a current trend in business...
-
Show how each transformation may be accomplished by using a nitrile as an intermediate. You may use any necessary reagents. (a) Hexan-1-ol heptan-1-amine (b) Cyclohexanecarboxamide cyclohexyl ethyl...
-
What is the Sharpe approach to measuring portfolio risk? If a portfolio has a higher Sharpe measure than the market in general under the Sharpe approach, what is the implication?
-
Describe the test statistic for the sign test when the sample size \(n\) is less than or equal to 25 and when \(n\) is greater than 25 .
-
The revenue recognition principle says a. record revenue only after you have earned it. b. record revenue only when you receive cash. c. match revenues and expenses in order to compute net income. d....
-
David Segal started a business. During the first month (October 20--), the following transactions occurred. (a) Invested cash in the business, $15,000. (b) Bought office supplies for $3,800: $1,800...
-
Describe how your personal and professional personas might influence society and your community. Discuss one way you would like to alter your own personal and professional personas to be more...
-
OTE operates in a stable industry and the results for the company were relatively consistent over the past five years. The December 31 year-end statements are provided in Appendix I. There are a few...
-
A ball is thrown from a height of 61 meters with an initial downward velocity of 6 m/s. The ball's height h (in meters) after t seconds is given by the following. h=61-61-57 How long after the ball...
-
A particle travels horizontally between two parallel walls separated by 1 8 . 4 m . It moves toward the opposing wall at a constant rate of 8 . 9 m / s . Also, it has an acceleration in the direction...
-
Given the following: Number purchased Cost per unit Total January 1 inventory 51 $ 3 $ 153 April 1 71 6 426 June 1 61 7 427 November 1 66 8 528 249 $ 1,534 a. Calculate the cost of ending inventory...
-
Mary's wages for January was obtained from regular pay, overtime pay and a bonus payment. Her regular pay for January amounted to 40% of her total wages. Of the remainder, 75% was obtained for...
-
The following selected accounts from Crane Corporation's general ledger are presented below for the year ended December 31, 2021: Accounts payable $82,320 Equipment $1,397,760 Accounts receivable...
-
PTL Ltd is a mining company. During the reporting period ending 30 June 2022, PTL Ltd started mining operations in Western Australia. The cost of the mining equipment and associated technology...
-
Who is liable if a client is purchasing a home and you as the buyers agent did not make additional options to them and something happens to the home?
-
Selected condensed data taken from a recent statement of financial position of Morino Ltd. are as follows. MORINO LTD. Statement of Financial Position (partial) Other current assets...
-
A specific project task has been estimated to require 100 work hours to complete. Using the adjustment factors in Figures 12.7 and 12.8, adjust this estimate to reflect the following. Figure 12.7...
-
The flowchart in Figure was prepared by a CPA to portray the raw materials purchasing function of one of her clients, a medium- sized manufacturing company, from preparing initial documents through...
-
The mail is opened by an accounting clerk. Vendor invoices are stamped with a voucher stamp and forwarded to the purchasing agent. The purchasing agent matches the receiving report, purchase order,...
-
Using Rayleigh's method, estimate the fundamental frequency for the lateral vibration of a uniform beam fixed at both the ends. Assume the deflection curve to be \[W(x)=c_{1}\left(1-\cos \frac{2 \pi...
-
Find the fundamental frequency of longitudinal vibration of the tapered bar shown in Fig. 8.41, using Rayleigh's method with the mode shape \[U(x)=c_{1} \sin \frac{\pi x}{2 l}\] The mass per unit...
-
Approximate the fundamental frequency of a rectangular membrane supported along all the edges by using Rayleigh's method with \[W(x, y)=c_{1} x y(x-a)(y-b)\] \[V=\frac{P}{2}...
Study smarter with the SolutionInn App