first commit
This commit is contained in:
10
PrimoProgetto/.classpath
Normal file
10
PrimoProgetto/.classpath
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
28
PrimoProgetto/.project
Normal file
28
PrimoProgetto/.project
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>PrimoProgetto</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1758261738047</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
2
PrimoProgetto/.settings/org.eclipse.core.resources.prefs
Normal file
2
PrimoProgetto/.settings/org.eclipse.core.resources.prefs
Normal file
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
14
PrimoProgetto/.settings/org.eclipse.jdt.core.prefs
Normal file
14
PrimoProgetto/.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,14 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=17
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=17
|
||||
BIN
PrimoProgetto/bin/PrimaClasse.class
Normal file
BIN
PrimoProgetto/bin/PrimaClasse.class
Normal file
Binary file not shown.
6
PrimoProgetto/src/PrimaClasse.java
Normal file
6
PrimoProgetto/src/PrimaClasse.java
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
public class PrimaClasse {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Ciao Mondo!");
|
||||
}
|
||||
}
|
||||
10
SecondoProgetto/.classpath
Normal file
10
SecondoProgetto/.classpath
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
28
SecondoProgetto/.project
Normal file
28
SecondoProgetto/.project
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>SecondoProgetto</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1758261738047</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
7
SecondoProgetto/.vscode/settings.json
vendored
Normal file
7
SecondoProgetto/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
||||
BIN
SecondoProgetto/bin/App.class
Normal file
BIN
SecondoProgetto/bin/App.class
Normal file
Binary file not shown.
BIN
SecondoProgetto/bin/Pentagono.class
Normal file
BIN
SecondoProgetto/bin/Pentagono.class
Normal file
Binary file not shown.
BIN
SecondoProgetto/bin/Poligono.class
Normal file
BIN
SecondoProgetto/bin/Poligono.class
Normal file
Binary file not shown.
BIN
SecondoProgetto/bin/Quadrato.class
Normal file
BIN
SecondoProgetto/bin/Quadrato.class
Normal file
Binary file not shown.
BIN
SecondoProgetto/bin/Rettangolo.class
Normal file
BIN
SecondoProgetto/bin/Rettangolo.class
Normal file
Binary file not shown.
BIN
SecondoProgetto/bin/Triangolo.class
Normal file
BIN
SecondoProgetto/bin/Triangolo.class
Normal file
Binary file not shown.
52
SecondoProgetto/src/App.java
Normal file
52
SecondoProgetto/src/App.java
Normal file
@@ -0,0 +1,52 @@
|
||||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
class Poligono {
|
||||
public int lati;
|
||||
public double[] misure = new double[lati];
|
||||
public double perimetro() {
|
||||
int sum = 0;
|
||||
for (int i = 0; i < lati; i++) {
|
||||
sum += misure[i];
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
public double semiperimetro() {
|
||||
int sum = 0;
|
||||
for (int i = 0; i < lati; i++) {
|
||||
sum += misure[i];
|
||||
}
|
||||
return sum/2;
|
||||
}
|
||||
}
|
||||
class Triangolo extends Poligono {
|
||||
public double area() {
|
||||
double a = misure[0];
|
||||
double b = misure[1];
|
||||
double c = misure[2];
|
||||
double p = Poligono.semiperimetro();
|
||||
double result = p*(p-a)*(p-b)*(p-c);
|
||||
return Math.sqrt(result);
|
||||
}
|
||||
}
|
||||
class Rettangolo extends Poligono {
|
||||
private double latolungo() {
|
||||
|
||||
}
|
||||
public double area(double latolungo, double latocorto) {
|
||||
return latolungo*latocorto;
|
||||
}
|
||||
}
|
||||
class Quadrato extends Poligono {
|
||||
public double area(double lato) {
|
||||
return lato*lato;
|
||||
}
|
||||
}
|
||||
class Pentagono extends Poligono {
|
||||
public double area(double lato) {
|
||||
double constarea = 1.72;
|
||||
return lato*lato*constarea;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user