Sie sind auf Seite 1von 2

Major Assignment Semester 2 -2020

INTERNATIONAL TRAINING INSTITUTE

2005: PROGRAMMING

Semester 2 – 2020 ASSIGNMENT – No: 1

DATE GIVEN: WEEK 6

FINAL DUE DATE: 18th December 2020 @ 4:30 PM

TOTAL: 100 Marks - PERCENTAGE: 20%

Assignment Description

This assignment consists of six (6) questions. The marks for each questions are shown beside
the questions. Read the instructions and questions carefully and write out your answers clearly.
Type out your answers and hand in a printed copy of your assignment answers with the official
institute cover page.

1. Why Java is called architectural neutral language? Use JVM, JDK, Different types of
platform in your description. [20 Marks]
2. Write a Java program that will used to compute grade calculation for the students. (Use
any one of the control statements, and get the input as marks, find the total, and compute
the grade and display it for individual subjects) [20 Marks]
3. Study the Java program below and answer the questions below.[5+5 Marks]
1. class Example2 {
2. Public static void main (String args[]{
3. int num;
4. num=100;
5. System.out.printlin (“This is num: “ +num);
6. num =num *2 + 1;
7. System.out.print (“The value of num*2 is”);
8. System.out.println (num);

a) Explain what each statement will do from line 1 to line 8.


b) What will be the output of the program when it is run? Write the output
correctly.

1
2005-Programming
Major Assignment Semester 2 -2020

4. Complete the following table. Declare the variable with the data type and assign a correct
data value. [10mks]

No: Data Types Variable Name Write the correct declaration code and
assign a correct data value to the
variable
1 integer y
2 short den
3 float a
4 byte big
5 double man
6 boolean open
7 char boy
8 String cat
9 Enum Month
10 Array marks

5. Define a class loan with Principle, Period and Rate as data members. Interest (float) is a
member function, which increases the rate of interest by the parameter value. If rate of
interest is same for all loans, use appropriate declarations and implement the class.
[20Marks]

6. Write a program having a base class Student with data member rollno and member functions
getnum() to input rollno and putnum() to display rollno. A class Test is derived from class
Student with data member marks and member functions getmarks() to input marks and
putmarks() to display marks. Class Sports is also derived from class Student with data
member score and member functions getscore() to input score and putscore() to display
score. The class Result is inherited from two base classes, class Test and class Sports with
data member total and a member function display () to display rollno, marks, score and the
total (marks + score). [20 Marks]

End of Assignment

Note:

Make sure your assignment is due before/on the DUE DATE: 18th December 2020 @ 4:30
PM.

2
2005-Programming

Das könnte Ihnen auch gefallen