Restore
This commit is contained in:
10
Labs/Lab2/Lab2Part1/Question6/.classpath
Normal file
10
Labs/Lab2/Lab2Part1/Question6/.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">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
17
Labs/Lab2/Lab2Part1/Question6/.project
Normal file
17
Labs/Lab2/Lab2Part1/Question6/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Question6</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>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
BIN
Labs/Lab2/Lab2Part1/Question6/bin/SumAndAverage.class
Normal file
BIN
Labs/Lab2/Lab2Part1/Question6/bin/SumAndAverage.class
Normal file
Binary file not shown.
17
Labs/Lab2/Lab2Part1/Question6/src/SumAndAverage.java
Normal file
17
Labs/Lab2/Lab2Part1/Question6/src/SumAndAverage.java
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
public class SumAndAverage {
|
||||
|
||||
public static void main(String[] args) {
|
||||
int sum = 0;
|
||||
int i = 111;
|
||||
do{
|
||||
sum += i;
|
||||
i++;
|
||||
}
|
||||
while(i <= 8899);
|
||||
System.out.println("The sum is " + sum);
|
||||
System.out.println("The average is " + (float)sum/100);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user