This document contains questions about classes and objects in Java. It asks the student to:
1) Define class and object terms, how objects are represented, why objects are instances of classes, and why classes are called object factories.
2) Solve math expressions and write code snippets to print output of arithmetic operations.
3) Write a program to accept a PAN number, name, taxable income and compute the tax based on income thresholds and rates.
This document contains questions about classes and objects in Java. It asks the student to:
1) Define class and object terms, how objects are represented, why objects are instances of classes, and why classes are called object factories.
2) Solve math expressions and write code snippets to print output of arithmetic operations.
3) Write a program to accept a PAN number, name, taxable income and compute the tax based on income thresholds and rates.
This document contains questions about classes and objects in Java. It asks the student to:
1) Define class and object terms, how objects are represented, why objects are instances of classes, and why classes are called object factories.
2) Solve math expressions and write code snippets to print output of arithmetic operations.
3) Write a program to accept a PAN number, name, taxable income and compute the tax based on income thresholds and rates.
a) Define the terms class and object. b)How is an object represented in software terms? c)Why is an object called an instance of a class? d)Why is class called an object factory? e) How do objects encapsulate state and behaviour. Q.2.Do as directed:- (2x5=10m) a) Write java expressions:- −b+ √ b2 −4 ac i) 2a ii)√ c 2 + a2+ b2 b)Write dry run and output:- int a=50,b=5,c=4; System.out.println((a*b)/c); System.out.println((a+b)+” “+c); System.out. println(c/b+” “+c%a); c) int i=3; i++; System.out.println(i); ++i; System.out.println(i); System.out.println(++i); System.out.println(i++); System.out.println(i); d) int a=11; a+=a++ + ++a + --a +a --; System.out.print(a); e)int y=9; y+=++y+y--+--y; System.out.println(y); Q.3.Write a program to accept pan number, name, taxable income And compute the tax <=100000 0% 100001-150000 10% of the income exceeding 100000 150001-250000 5000+20% of the income exceeding 150000 >250000 25000+ 30% of the income exceeding 250000 display the details of the employee.