Download GTU B.Tech 2020 Winter 7th Sem 2170309 Introduction To Java And Visual C++ Question Paper

Download GTU (Gujarat Technological University Ahmedabad) B.Tech/BE (Bachelor of Technology/ Bachelor of Engineering) 2020 Winter 7th Sem 2170309 Introduction To Java And Visual C++ Previous Question Paper

Seat No.: ________
Enrolment No.___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE- SEMESTER?VII (NEW) EXAMINATION ? WINTER 2020
Subject Code:2170309 Date:25/01/2021
Subject Name:Introduction to JAVA & Visual C++
Time:10:30 AM TO 12:30 PM Total Marks: 56
Instructions:
1. Attempt any FOUR questions out of EIGHT questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.



MARKS
Q.1
(a)
Define following terms:
03
1. Coercion 2. Polymorphism 3. Applet

(b) Define constructor with its properties. Can they be overloaded?
04

(c)
Explain in detail the life cycle of a Thread.
07


Q.2
(a)
Explain the try-catch statement with one example.
03

(b) Explain command-line interface.
04

(c)
Write an application that executes following mentioned threads.
07
1. Displays "HELLO" every 2000 milliseconds
2. Displays "WORLD" every 4000 milliseconds.
Create the threads by implementing the Runnable interface.




Q.3
(a)
Explain the basic structure of C++ program.
03

(b) Explain briefly virtual functions in Visual C++
04

(c)
Write a program for drawing a Circle in Visual C++.
07




Q.4
(a)
Explain briefly Inheritance and Write an example of inheritance.
03

(b) Explain briefly nested classes in Visual C++.
04

(c)
Write a program for drawing following shapes in Visual C++.
07
1. Rectangle
2. Square
Q.5
(a)
Define below listed terms:
03
1. Type Casting 2. IDE 3. API

(b) Determine output of following code:
04
public static void P()
{ int i=0, s=1;
for(i=1; i<=3; i++);
s=s+i++;
System.out.println(s+" "+i);
}

(c)
Explain in detail package and interface with appropriate example.
07



Q.6
(a)
Define access specifiers. Draw a table showing all the access specifiers
03
and their accessibility in the class, package, subclasses and other
packages.
1


(b) What will be the output of following mentioned codes:
04
{ int a=5+2*2/7%3;
double b=10/100*25;
double c=25*10/100;
double d=25*.1;
Systemout.print(a);
Systemout.println(b);
Systemout.println(c);
Systemout.print(d);
}

(c)
Enlist the uses of mentioned below of Thread class with example:
07
1. wait()
2. notify()
3. sleep()
Q.7
(a)
Explain abstract classes and abstract methods with appropriate examples.
03

(b) Develop a program in JAVA to convert following:
04
1. Centimeter to Meter
2. Kilogram to Grams

(c)
Develop a code for a BMI (Body Mass Index) calculator in JAVA.
07



Q.8
(a)
Differentiate Pure and Impure Functions.
03
(b) Write a program to convert Fahrenheit to Celsius in JAVA.
04
(c)
Design a JAVA code for a simple calculator.
07

*************
2

This post was last modified on 04 March 2021