Project(Pno, title, budget, deptno, rating) Department(Deptno, name, no_of_projects); Emp(empno, first_name, last_name, salary, gender, job_title) Write a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Project(Pno, title, budget, deptno, rating) Department(Deptno, name, no_of_projects); Emp(empno, first_name, last_name, salary, gender, job_title) Write a function called count_by_gender that will accept a deptno value and a gender value as parameters and return the total number of employees with the given gender in that department. The following conditions are to be treated as exceptions: Handle a relevant named exception by returning -11 If the gender parameter is not 'f' or 'm; return -12 (Hint: This is a user defined exception) Handle the socket exception ORA-08001 by returning -13 the public prival private Publ Question 5 (15 points) What will be the output of the given program? Briefly explain. ublic class Main ( public static void main(String[] args) { int a-2, b-4, c-0; int v[]; try( a+-b: b+-a; c - 10/(a-8); System.out.println("a"+a+" b="+b+" c="+c); v new int [a]: System.out.println("Array v is allocated."); v[a+b]-10; c += 20; System.out.println("Some values are updated"); System.out.println("Arithmetic exception handled."); } catch (ArithmeticException e) { a++; b += 2*a; System.out.println("Index out of bounds exception handled."); } catch (IndexOutOfBoundsException e) { b++; a - 2; 9 -- ; System.out.println("Runtime exception handled."); } catch (RuntimeException e) { c++; System.out.println("At the end a="+a+" b="+b+" c="+c); Project(Pno, title, budget, deptno, rating) Department(Deptno, name, no_of_projects); Emp(empno, first_name, last_name, salary, gender, job_title) Write a function called count_by_gender that will accept a deptno value and a gender value as parameters and return the total number of employees with the given gender in that department. The following conditions are to be treated as exceptions: Handle a relevant named exception by returning -11 If the gender parameter is not 'f' or 'm; return -12 (Hint: This is a user defined exception) Handle the socket exception ORA-08001 by returning -13 the public prival private Publ Question 5 (15 points) What will be the output of the given program? Briefly explain. ublic class Main ( public static void main(String[] args) { int a-2, b-4, c-0; int v[]; try( a+-b: b+-a; c - 10/(a-8); System.out.println("a"+a+" b="+b+" c="+c); v new int [a]: System.out.println("Array v is allocated."); v[a+b]-10; c += 20; System.out.println("Some values are updated"); System.out.println("Arithmetic exception handled."); } catch (ArithmeticException e) { a++; b += 2*a; System.out.println("Index out of bounds exception handled."); } catch (IndexOutOfBoundsException e) { b++; a - 2; 9 -- ; System.out.println("Runtime exception handled."); } catch (RuntimeException e) { c++; System.out.println("At the end a="+a+" b="+b+" c="+c);
Expert Answer:
Posted Date:
Students also viewed these computer network questions
-
Another liability that employers have is that of unemployment insurance. Class, let's talk about this a little more. At what levels are unemployment liabilities incurred? What are some additional...
-
In random samples of 12 from each of two normal populations, we found the following statistics: x1 = 74s1 = 18 x2 = 71 s2 = 16 a. Test with = .05 to determine whether we can infer that the...
-
Hello, I started my HW assignment. Please help with #2 and #4. And please let me know if I calculated the stock value correctly (part #3)? Thank you! Visit finance.yahoo.com, do some research and...
-
The 2015 annual report of Bristol-Myers Squibb (BMS) reveals that the company maintains a large investment in available-for-sale securities: Did the companys available-for-sale securities experience...
-
Do you believe that the PCAOB overstepped its regulatory role and responsibilities by beginning a dialogue regarding the possible need for mandatory audit firm rotation? Why or why not? Do you agree...
-
A company has the following expenditures related to fixed asset acquisition. Buildings $220,000 Mortgage interest, $25,000 Equipment $50,000 Machinery $25,000 Land $200,000 Which of these items are...
-
Discuss the classification of the 4 types of manufacturing process and cite exampe 1. Jobbing manufacturing process 2. Batch manufacturing process 3. Mass or flow manufacturing process 4. Process...
-
What do you think of the course of action that McKay advocates in response to white antiblack violence? How does McKay's poem serve to inspire African Americans to stand up for themselves? What do...
-
As settlement of a100,000 death benefit, a beneficiary elected to take anannuity-immediate payable monthly for 25 years. The monthly paymentwas calculated using an effective annual interest rate of...
-
Success in business and in life requires the development of critical thinking skills. Critical thinking requires the ability to understand what someone is saying and then to ask specific questions...
-
Company A issues 2000 convertible notes on 1 July 2012. The notes have a 3-year term and are issued at par with a face value of K1000 per note, giving total proceed at the date of issue of K2, 000...
-
Summarize the study and interpret its findings for a lay audience. Focus on objectively translating this study for a lay audience. Consider how this study relates to current and emerging issues in...
-
Customs law imposes 3 basic obligations (1) to report goods to customs, (II) to make due entry of them, and (III) to pay duties and taxes that are applicable. True False
-
Three successive resonance frequencies in an organ pipe are 1310, 1834, and 2358 Hz. (a) Is the pipe closed at one end or open at both ends? (b) What is the fundamental frequency? (c) What is the...
-
Graham Corporation used the following data to evaluate its current Kin operating system. The company sells items for \($10\) each and used a budgeted selling price of \($10\) per unit. a. Prepare the...
-
Selected data for Miller Company, which operates three departments, follow: During the year, the companys fixed expenses included the following: Assume that the property tax rate is the same for both...
-
Johnson Company has two sources of funds: long term debt and equity capital. Johnson Company has profit centers in the following locations with the following net incomes and total assets: a....
Study smarter with the SolutionInn App