Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Java program for calculating the distance, Assignments of Local Area Network (LAN)

These documents are my college assignments for three java programs I was required to make. The first two discuss elementary programming and the last one is an introduction to Object Oriented Programming

Typology: Assignments

2023/2024

Uploaded on 03/10/2024

im-a-person-1
im-a-person-1 🇪🇬

3 documents

1 / 4

Toggle sidebar

Related documents


Partial preview of the text

Download Java program for calculating the distance and more Assignments Local Area Network (LAN) in PDF only on Docsity! class MyRectangle2D{ private double x; private double y; private double width; private double height; public MyRectangle2D(){ x=0; y=0; width = 1; height = 1; } public MyRectangle2D(double x, double y, double w, double h){ this.x=x; this.y=y; width = w; height = h; } public double getx(){ return x; } public double gety(){ return y; } public double getw(){ return width; } public double geth(){ return height; } public void setx(double x){ this.x=x; } public void sety(double y){ this.y=y; } public void setw(double w){ width=w; } public void seth(double h){ height=h; } public double getArea(){ return (width*height); } public double getPerimeter(){ return (2*(width+height)); } public void print(){ System.out.println("Width of the rectangle = " + width);
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved