First Term Question of CSC 383 D
First Term Question of CSC 383 D
Instructions: (1) Answer all the questions. (2) Take a photo or download the question paper as soon as you
open it. (3) Marks allocated are indicated in the right margin. (4) After completing the examination, take
photo of your answer script, convert it to PDF (name should be like 17103333_CSC383) and submit it to
the google classroom link where the question will be uploaded. If you face any problem to upload in the
google classroom then send to the e-mail address: ([email protected]) and in your e-mail subject line
must be “First Term Exam of CSC 383” (5) You must write your name, ID number and page number on
every page of your answer script. Also, please sign on every page. Write your mobile number on the first
page only. (6) If necessary, contact course instructor by phone: (01931235286).
1. JAVA is a high level programming language. It introduces the concept of JAVA CLO1 20
virtual machine(JVM). JAVA is a platform independent language but JVM is platform PO1
dependent. Now explain why Java is both compiled and interpreted language. C2
2. Object Oriented feature of JAVA support overloading and overriding. In overloading CLO1 10*2=20
multiple method in a single class can have same name and in overriding methods from PO2
two different class can have same name. C2
public class FirstMethod{
FirstMethod(int x)
{
}
final public static void method(int x, float y)
{…….
}
}
public class SecondMethod extends FirstMethod{
FirstMethod(int x)
{
}
public static void method(int x, float y)
{…………….
}
}
a) Now from the given program explain which errors are going to occur here.
b) Explain how to resolve these errors.
IUBAT—International University of Business Agriculture and Technology
[ Founded 1991 by Md. Alimullah Miyan]
3. In foodpanda app you can search for your expected food from different shops. But in CLO1 20
some of the areas they do not deliver foods. If your area belongs to their specified PO2
area, then you can order multiple foods. Now write a program to implement these C3
features. Some of the values will be predefined.
Areas to give delivery: A, B, C only
Food items: Pizza, Burger, Coke
At first you will give the input of the area. If it matches with the given value, then
delivery will be done or else program will end. Then the user will have to give input
of the food items one by one. Finally, the program will print the whole order.
For example:
Your area: D
No delivery in this area (program will end here)
Your area: A
Your order please:
Item name: Pizza
Anything else:
No
Your total order will be Pizza (program will end here)
Yes
Item Name: Coke
Anything else:
No
Your total order will be Pizza, Coke (program will end here)
Yes
Item Name: Burger
That’s all we have in the menu.
Your total order will be Pizza, Coke and Burger
IUBAT—International University of Business Agriculture and Technology
[ Founded 1991 by Md. Alimullah Miyan]
5. Explain the compile time error of the given code with reason for it. CLO1 10
class ABC{ PO2
private double num = 100;
C3
private int square(int a){
return a*a;
}
}
public class Example{
public static void main(String args[]){
ABC obj = new ABC();
System.out.println(obj.num);
System.out.println(obj.square(10));
}
}