lab-02:
- Project files - _Rectangle class
This commit is contained in:
parent
f4fa262bd9
commit
4a8354a474
3
lab-02/.idea/.gitignore
vendored
Normal file
3
lab-02/.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
6
lab-02/.idea/misc.xml
Normal file
6
lab-02/.idea/misc.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
lab-02/.idea/modules.xml
Normal file
8
lab-02/.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/lab-02.iml" filepath="$PROJECT_DIR$/lab-02.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
lab-02/.idea/vcs.xml
Normal file
6
lab-02/.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
11
lab-02/lab-02.iml
Normal file
11
lab-02/lab-02.iml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
33
lab-02/src/_Rectangle.java
Normal file
33
lab-02/src/_Rectangle.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
public class _Rectangle {
|
||||||
|
|
||||||
|
private double width;
|
||||||
|
private double height;
|
||||||
|
|
||||||
|
public _Rectangle(double w){
|
||||||
|
this.width = w;
|
||||||
|
}
|
||||||
|
|
||||||
|
public _Rectangle(double w, double h){
|
||||||
|
this.width = w;
|
||||||
|
this.height = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getArea(){
|
||||||
|
return this.height*this.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWidth(double w){
|
||||||
|
this.width = w;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeight(double h){
|
||||||
|
this.height = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getWidth(){ return this.width; }
|
||||||
|
public double getHeight(){ return this.height; }
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return " ";//TODO: _Rectangle toString output format
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user