object oriented programming Assignment 1, Assignments of Object Oriented Programming

classes and objects, methods, comprises with basic oop terminologies, its detailed assignment

Typology: Assignments

2019/2020

Uploaded on 10/25/2020

mehwish-mehmood
mehwish-mehmood 🇵🇰

2.3

(3)

6 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Question No 1: Short Q/A [4
Marks]
1) Explain the following OOP terminologies:
a. Data Abstraction
b. Encapsulation
c. Information Hiding
2) What are the characteristics of an object?
3) What does a constructor do? What are the syntactic differences between a constructor and a
method?
4) Differentiate among instance variable, class variable and local variable.
5) Explain the different between public, private, protected and default access modifiers of a
class attribute.
6) What is a package? How can you define your own package? Why we should use the
package?
7) Explain why you might need to define a member of a class as static? Give one example.
8) What are the different techniques to assign values to attribute? Given example of each
technique.
Question No 2: Programming (6 Marks)
a) Write a java class that multiplies the long number. The class will receive multiplicand and
multiplier as string inputs, convert string values to their digit represent and show the partial
products and product as shown in the example below: [1 Marks]
SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY
BI0NFORMATICS DEPARTMENT
FALL 2019
OBJECT ORIENTED PROGRAMMING (CS-224)
Assignment 1
Semester: VI Batch: 2018
Due Date: 08-July-2019 Max Marks: 10
Instructions:
Attempt all questions
pf2

Partial preview of the text

Download object oriented programming Assignment 1 and more Assignments Object Oriented Programming in PDF only on Docsity!

Question No 1: Short Q/A [

Marks]

  1. Explain the following OOP terminologies: a. Data Abstraction b. Encapsulation c. Information Hiding
  2. What are the characteristics of an object?
  3. What does a constructor do? What are the syntactic differences between a constructor and a method?
  4. Differentiate among instance variable, class variable and local variable.
  5. Explain the different between public , private, protected and default access modifiers of a class attribute.
  6. What is a package? How can you define your own package? Why we should use the package?
  7. Explain why you might need to define a member of a class as static? Give one example.
  8. What are the different techniques to assign values to attribute? Given example of each technique.

Question No 2: Programming (6 Marks)

a) Write a java class that multiplies the long number. The class will receive multiplicand and multiplier as string inputs, convert string values to their digit represent and show the partial products and product as shown in the example below: [1 Marks]

SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY

BI0NFORMATICS DEPARTMENT

FALL 2019

OBJECT ORIENTED PROGRAMMING (CS-224)

Assignment 1 Semester: VI Batch: 2018 Due Date: 08-July-2019 Max Marks: 10 Instructions:  Attempt all questions

Write an application class to demonstrate the working of above class. b) Write a method in java that compute five digit integer no into single digit by adding this no. [1 Marks] c) Write a java class has a method that takes user name as input and second functions which returns number of vowels present in it and Main program prints the number of vowels [ 1 Marks] d) Create a rectangle class with two data members’ length and width Provide member functions to calculate the perimeter and area of the rectangle and a function square which returns true if the rectangle is a square otherwise it returns false. [1.5 Marks] e) Write a class to simulate a bank account allowing for initialization, deposits, withdrawals, setting the interest rate, adding interest and giving the current balance. Provide some code to demonstrate the object in action. [ 1.5 Marks]