Solution to 18CS45 OOC Module 2 Question Bank

 

The solution to 18CS45 OOC Module 2 Solved Question Bank

Here you can find the solution to the 18CS45 OOC Module 2 Question Bank.

1. Write a C++ program to get the employee details (empno, emp name, bsalary (initialized to 1000 by constructor) and allowance) of the Employee class through the keyboard using the method GetData() and display them using the method DispData() on the console in the format empno, empname, bsalary, allowance. VTU: July 18, Marks 8

2. What is a constructor? List the different types of constructors and explain the default constructor with an example. Jan.-18, Marks 6

3. What is a constructor? Mention its types. Explain parameterized constructor with an example.  Jan.-19, Marks 6

4. What is a constructor? Mention its type. Explain the parameterized constructor with a suitable code.  July-19, Marks 8

5. Write a C++ program to define an Employee class with the following Members: Data  Members: empid, emp salary Member Functions: to read a data and to print the data. The program should use an array within the class to read 3 employee information and print the 3 employee information.

6. Discuss briefly the concept of byte code in Java. July 18, Marks 4

7. Elucidate how Java is a platform-independent language, with neat sketches. July 18, Marks 6

8. Define byte code. How does it help Java program(s) achieve portability?  Jan.-19, Marks 5

9. Describe the concept of byte code.  July-19, Marks 4

10. How “compile once and run anywhere” is implemented in JAVA? Discuss.  July-17, Marks 4

11. List and explain the Java buzzwords.  July-17, 19, Jan.-19 Marks 8

12. Explain how Java is robust and interactive.  Jan.-18, Marks 5

13. Explain the structure of the Java program with an example. July-18 Marks 10

14. Write a Java program to initialize and display different types of integer and floating point variables. Jan.-18, Marks 6

15. Explain the operation of the following operators with an example.  Jan 18 Marks 6

i) % ii) >>> il) &&

16. With an example, explain in working of >> and >>> (unsigned right shift). Jan 19 Marks 4

17. List the different types of operators. Explain any three.   July 19 Marks 8

18. Explain the concepts of arrays in Java with examples. Also, write a program that creates and initializes a four integer elements array. Find the sum and average of its values. July-17, Marks 8

19. How to declare two-dimensional arrays in java? Explain with a simple example. Jan.-18, Marks 4 

20. How arrays are defined in Java? Explain with an example. July 18, Marks 4

21. Explain the switch case with an example. July-19, Marks 6

22. Write a Java program to find the factorial of a number ‘n’ using for loop. Jun.-18, Marks 6 

23. Write a java program to find the sum array elements. Jan.-18, Marks 5

24. Define type casting. Explain with an example. July 2017, Jan 19 Marks 5

25. Define type casting. Illustrate with an example. What is the meaning of automatic type conversion? Jan 18 Marks 6

26. Write a Java program to print first ‘n’ Fibonacci numbers.

27. Write a Java program to reverse a given number.

28. Write a Java program to find the number of and the sum of all numbers greater than 100 and less than 200 (inclusive of both) which are divisible by 7.

29. List and explain control statements in java.

30. Write a Java program to check whether a given number is prime or not.

31. Write a Java program to find all prime numbers in the given range.

32. Write a Java program to check whether a given number is palindrome or not.

The solution to 18CS45 OOC Module 1 Solved Question Bank

The solution to 18CS45 OOC Module 2 Solved Question Bank

The solution to 18CS45 OOC Module 3 Solved Question Bank

The solution to 18CS45 OOC Module 4 Solved Question Bank

The solution to 18CS45 OOC Module 5 Solved Question Bank

18CS45 Object-Oriented Concepts VTU CBCS Notes

Summary:

This article provides the solution to the 18CS45 OOC Module 2 Solved Question Bank. If you like the tutorial share it with your friends. Like the Facebook page for regular updates and the YouTube channel for video tutorials.

Welcome to VTUPulse.com


Computer Graphics and Image Processing Mini Projects -> Click Here

Download Final Year Project -> Click Here

This will close in 12 seconds