logo

Object Oriented Programming with Java

Develop and implement a well-designed modularised solution to a small programming problem.

6 Pages619 Words334 Views
   

Added on  2022-11-30

About This Document

This document provides an introduction to Object Oriented Programming with Java. It covers the basics of classes, objects, methods, and inheritance. It also includes pseudocode examples to help understand the concepts. This is a useful resource for beginners learning Java programming.

Object Oriented Programming with Java

Develop and implement a well-designed modularised solution to a small programming problem.

   Added on 2022-11-30

ShareRelated Documents
Object Oriented Programming with Java
Name of the Student:
Name of the University:
Object Oriented Programming with Java_1
Pseudocode:
Start Program:
import java.util.Scanner; /* take primitive inputs (int, char, float, double, etc.) from the
user */
Step 1:
Create class Person:
Local variable declaration:
Define getDetails() method:
Display person details using show() method:
End of class:
Step 2:
Create class Calculate:
Local variable declaration:
Creating an object ‘sc’ of scanner class: /*Scanner sc= new Scanner(System.in);*/
Define calculate() method:
Start for loop: /*which will calculate the saving down payment of 5
people*/
Object Oriented Programming with Java_2
Start if:
/* If statement define the condition for the down payment scheme and store the
cvalue in the price variable */
Enf if:
Calculate years: /* average of years to save their down payment */
End of for loop:
Print “Saving down payment price “, price
Return year: /*since the return type of calculate() method is int, hence it will
return some value, here the calculate() method retuen years*/
End of class:
Step 3:
Main class:
Main method:
/* if any exception caught by main() method it will through an exception
called “throws java.io.IOException”
Local variable declararion:
Creating and instantiate an object ‘sc’ of Scanner class.
Creating and instantiate an object ‘c’ of Calculate class.
Object Oriented Programming with Java_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Object Oriented Programming with Java
|9
|1142
|153

Java Programming Assignment: Comma-Separated Integer Inputs and Exception Handling
|8
|937
|481

SIT105 Critical Thinking and Problem Solving | Report
|9
|1576
|285

Task 2. 2.2 The main part of the program can use a FOR
|9
|750
|196

Assignment on Algorithms And Programming
|27
|4937
|106

Methodology for Desklib Online Library SEO
|3
|1530
|187