< 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 . ....
-
Prepare a search strategy for understanding a due diligence review of a company. Implement the strategy to find five important items in a due diligence review.
-
JAG Manufacturing Company produces and sells one main product. There is significant seasonality in demand, and the unit price is quite high. As a result, during the heavy selling season, JAG...
-
What do you know about the mathematical value of the annual worth of a project under each of the following conditions? a. The present worth of the project is greater than 0 . b. The present worth of...
-
The Brown Shoe Company produces its famous shoe, the Divine Loafer that sells for $60 per pair. Operating income for 2011 is as follows: Sales revenue ($60 per pair) $300,000 Variable cost ($25 per...
-
3. Assume that the web-hosting service industry is pertectly competitive and that all web-hosting service providers are identical. Also assume that web-hosting services occur at datacenters that...
-
Dwight Donovan, the president of Donovan Enterprises, is considering two investment opportunities. Because of limited resources, he will be able to invest in only one of them. Project A is to...
-
1. In operating system, each process has its own a address space and global variables b. open files 2. A PCB hold information for a. Process open files b. Program counter 3. FCFS algorithm is a....
-
Who influences the responsibilities/ expectations and output requirements of a workplace team?
-
Identify 2 different population health issues. Compare how the public health departments approached each chosen population health issue.
-
How the Aboriginal and/or Torres Strait Islander Peoples learn the mathematics? List and describe two such learning ways.
-
Describe what is meant by corporate culture. Identify and briefly describe the four different types of cultures that companies may adopt after a merger or acquisition.
-
What is cross-cultural training (CCT)? Identify and briefly describe the steps that must be planned and implemented to ensure successful training.
-
A 20-year maturity bond that makes coupon payments annually has a duration of 10.865 years, convexity of 160.59, and coupon rate of 8%. The bond sells at a yield to maturity of 5%. If the market rate...
-
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
-
Do any problems arise when translating physical assets and economic events into monetary units? Give one or two illustrations to support your answer.
-
Entries for the Warren Clinic 2015 income statement are listed below in alphabetical order. Reorder the data in proper format. Depreciation expense General/administrative expenses Interest expense $...
-
Brandywine Homecare, a not-for-profit business, had revenues of \($12\) million in 2015. Expenses other than depreciation totaled 75 percent of revenues, and depreciation expense was \($1.5\)...
Study smarter with the SolutionInn App