< Q1 of 34 Which of the following are invalid variable declarations? double salary = 123467;...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
< Q1 of 34 Which of the following are invalid variable declarations? double salary = 123467; int 1value = 2147483648; char gender = "M"; long bonus = 35000L; boolean flag = False String name = 'Alex' < Q2 of 34 Consider the code given below. class Employee{ public int employeeId; private double basicsalary; private double totalSalary; public Employee (double basic salary) ( this.basicsalary basicsalary; } public double getBasicSalary() { return basicsalary; W public double getTotalsalary() { return totalsalary; } public int get EmployeeId() { return employeeId; public double calculateTotalSalary(int bonusPercent) { // Line 21. return totalsalary; Tuna hora 4 } public class Tester ( public static void main(String[] args) ( " Employee employee new Employee(2100.5); employee.employeeld 101; employee.calculateTotalsalary(8); < You need to help the developer to display the following output by choosing the appropriate code to be implemented in Line 21 and Line 32. Employee Id: 101. Total salary: 2268.54 Q3 of 34 // Line 321 Line 21-this.totalSalary=this.basicSalary (1+ bonusPercent / 100); Line 32-System.out.println("Employee Id: " + employee.employeeld +". Total salary:" + employee.totalSalary); Line 21-this.totalSalary this.basicSalary *(1 + (double) bonusPercent/100); Line 32-System.out.println("Employee Id: " + employee.getEmployeeld()+", Total salary:" + employee.getTotalSalary()); Type here to search Ei 39 C SAMSUNG KA r Q3 of 34 What will be the output of the code given below? public class Tester ( O 28 26 public static void main(String[] args) { int num1 28; int num2 36; int num3 = 0; if ((num2/ num1) < 0 && (num1 + num2) % 4= 0) { num1 num1 + --num3; 25 } if ((num2 / num1) > 1 || num3= 0) { num1 num1 + num3++; system.out.println(numi +-num3); } else { Compilation error- undefined - type } System.out.println(num1+-num3); < Q1 of 34 Which of the following are invalid variable declarations? double salary = 123467; int 1value = 2147483648; char gender = "M"; long bonus = 35000L; boolean flag = False String name = 'Alex' < Q2 of 34 Consider the code given below. class Employee{ public int employeeId; private double basicsalary; private double totalSalary; public Employee (double basic salary) ( this.basicsalary basicsalary; } public double getBasicSalary() { return basicsalary; W public double getTotalsalary() { return totalsalary; } public int get EmployeeId() { return employeeId; public double calculateTotalSalary(int bonusPercent) { // Line 21. return totalsalary; Tuna hora 4 } public class Tester ( public static void main(String[] args) ( " Employee employee new Employee(2100.5); employee.employeeld 101; employee.calculateTotalsalary(8); < You need to help the developer to display the following output by choosing the appropriate code to be implemented in Line 21 and Line 32. Employee Id: 101. Total salary: 2268.54 Q3 of 34 // Line 321 Line 21-this.totalSalary=this.basicSalary (1+ bonusPercent / 100); Line 32-System.out.println("Employee Id: " + employee.employeeld +". Total salary:" + employee.totalSalary); Line 21-this.totalSalary this.basicSalary *(1 + (double) bonusPercent/100); Line 32-System.out.println("Employee Id: " + employee.getEmployeeld()+", Total salary:" + employee.getTotalSalary()); Type here to search Ei 39 C SAMSUNG KA r Q3 of 34 What will be the output of the code given below? public class Tester ( O 28 26 public static void main(String[] args) { int num1 28; int num2 36; int num3 = 0; if ((num2/ num1) < 0 && (num1 + num2) % 4= 0) { num1 num1 + --num3; 25 } if ((num2 / num1) > 1 || num3= 0) { num1 num1 + num3++; system.out.println(numi +-num3); } else { Compilation error- undefined - type } System.out.println(num1+-num3);
Expert Answer:
Answer rating: 100% (QA)
Answer 1 Here invalid declarations are i int 1value2147483648 varible name cannot st... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Which of the following are private goods and might, therefore, be provided in socially optimal amounts by private profit-maximizers? Which are public goods and should, therefore, be provided by the...
-
Which of- the following are electron-deficient compounds? Explain. (a) (b) CH3 CH H C CHy H3C CH,
-
Which of the following are Section 1231 assets? Explain. Assume all the items have been held long-term. a. Machinery used in the business b. Personal home c. Factory building d. Land held as an...
-
public class Class extends ClassA public classB ( ( Time left 0 0 : 1 2 : 0 3 int init = 1 0 ; super ( 4 0 ) ; O a . . The method super is not defined. b . . No values may be passed to super. O c . ....
-
At the beginning of the 2006 school year, Hakim Davis decided to prepare a cash budget for the months of September, October, November, and December. The budget must plan for enough cash on December...
-
How do you find the absolute maximum and minimum values of a function that is continuous on a closed interval?
-
The following selected accounts and balances appear on the adjusted trial balance for Ray Service, Inc., on December 31, 2010: 1. What is the net income or net loss? 2. What is the change in Retained...
-
Recent balance sheet information for two companies in the food industry, H.J. Heinz Company and The Hershey Company, is as follows (in millions of dollars): a. Determine the ratio of liabilities to...
-
P5: Errors & Changes in Accounting Policy & Tax Strategy Ramadan began operations on January 1, 2023. Financial statements for 2021 and 2022 contained the following errors: Dec. 31, 2021 Dec. 31,...
-
On August 7, Blue Ocean Inflatables Co. paid $2,800 to install a hydraulic lift and $40 for an air filter for one of its delivery trucks. Journalize the entries for the new lift and air filter...
-
The future value of an ordinary annuity generally less than the future vlaue of an identical annuity due becasue An ordinary annuity generates payments at the end of each period. Annuities due, on...
-
What frameworks do we use to facilitate strategic decision-making and cross-functional collaboration across the organization?
-
You will review and reply to Case Study: Confronting Gun Violence with Data Case Study: Confronting Gun Violence with Data Discussion Question Listen to the following podcast: The University of...
-
Candlesora Lamp Company has the following information related to its manufacturing and selling of desk lamps. Current selling price, per unit $ 1 1 . 0 0 Direct materials, per unit $ 4 . 0 0 Direct...
-
8) The massless ring shown on the right is at equilibrium. What is 0, the angle between the rope providing T3 and the rope providing T? T Sina Sin =80 N T = 50 N T=80 50 Sin (0) 60
-
1. Explain briefly how spending can multiply, and then calculate the spending multiplier when the MPC is a. 0.75 b. 0.8 c. 0.6 2. The economy is experiencing a contraction (recessionary gap) of $400...
-
Exercise 6-9 (Algo) Specific identification LO P1 Ending inventory consists of 40 units from the March 14 purchase, 80 units from the July 30 purchase, and all 190 units from the October 26 purchase....
-
Pappa's Appliances uses the periodic inventory system. Details regarding the inventory of appliances at January 1, purchases invoices during the year, and the inventory count at December 31 are...
-
The following compound is not aromatic even though it has 4n + 2 electrons in a continuous cyclic array. Explain why this compound is not aromatic.
-
Give a curved-arrow mechanism for each of the reactions given in Fig. P20.51. OC,H, dil. HCI (catal ,- OC2Hs an orthoester 0 CIH O C CH dil HOI (catalyst) CH OH (e) H,C ,--, carbon monoxide CH Ph Ph...
-
The following compound is isolated as a by-product in the Chichibabin reaction of pyridine and sodium amide. Give a curved-arrow mechanism for its formation. NNH N
-
What is a post-mortem?
-
A __________ is another name for a project close-out meeting A. celebration B. post project C. final review D. post mortem
-
What advice about project closing is most useful to you? What other advice would you add?
Study smarter with the SolutionInn App