Objective of opp in java, Slides of Computer Science

Topic is on method creating java

Typology: Slides

2021/2022

Uploaded on 01/05/2023

Kutaga
Kutaga 🇹🇿

1 document

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5

Partial preview of the text

Download Objective of opp in java and more Slides Computer Science in PDF only on Docsity!

RUAHA CATHOLIC UNIVERSITY RDC 216 - OBJECT ORIENTED PROGRAMMING A ASSIGNMENT QUESTIONS 2021/2022 d Le Aon .y we & Weight: 16 Coursework Points Ve \ We, ce . ° 4 wo We Submission Deadline: 26" January, 2022 \ st dnd discuss the characteristics of objects as used in object-oriented programming, ielly discuss the following OOP concepts: Polymorphism, Abstraction, Encapsulation, Inheritance. 3.a) What is the relationship between the String and the character data types in Java? b) List any four data types used in Java other than the String and the character type. 4. What is the use of data members in a class? 5. Programmers, such as Java programmers, often need to use access modifiers when writing computer programs. The ac a) Why do we need access modifiers at the top level? modifier: can be used at the top level or the member level. b) When programmers usc private constructors, what exactly do they want to achieve? 6. There are three alternatives that you would use to access a public package member from outside its package: i, Referring to the member by its fully qualified name ii. Importing the package member iii, Importing the member's entire package What advantage does the first approach (Referring to the member by its fully qualified name) have over the other two approaches? 7.) Write any Java program with a loop inside another loop. b) Write any Java program with a conditional statement inside a loop. c) Write any Java program with a loop inside a conditional statement. d) Write any Java program with a conditional statement inside another conditional statement . 8. What is the function of scan.close(); in the following program? import java.util. Scanner; public class ScannerExample { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print("Enter an integer number: "); int num = scan.nextInt(); scan. close(); System.out.printIn("The number entered by user: "++num); } } 9, a) What are Multidimensional Arrays? b) Write any two Java programs to demonstrate the Multidimensional Arrays concept. c) There are 12 students in a “Diploma in Computer Sciences” class at Ruaha Catholic University. Write a Java program to print scores for these students, for the course “RDC 216”, Assume the students’ scores are as follows: 45,3, 55,77, 44.8, 87, 76.5, 74.4, 65.8, 61, 9, 79.2 and 49 Your program should store these scores in an array before printing them out. The program should also calculate the sum of all these scores and print this sum. Further, the program should find the largest score and print it out. Scanned wilh CamScunner