Skip to content

Commit

Permalink
feat(3.2.1): Finished U3_L2_Activity_One
Browse files Browse the repository at this point in the history
  • Loading branch information
101zh committed Oct 9, 2023
1 parent 27d3641 commit 280cb2c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"configurations": [
{
"type": "java",
"name": "U3_L2_Activity_One",
"request": "launch",
"mainClass": "Unit3.U3_L2_Activity_One",
"projectName": "my-app"
},
{
"type": "java",
"name": "Testing",
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/Unit3/U3_L2_Activity_One.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package Unit3;

import java.util.Scanner;

public class U3_L2_Activity_One {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter five numbers");
double[] nums = new double[5];

for (int i = 0; i < 5; i++) {
nums[i] = scanner.nextDouble();
}

double average = 0.0;

for (int i = 0; i < 5; i++) {
average += nums[i];
}

average /= 5;

if (average>=89.95){
System.out.println("ABOVE AVERAGE");
}

scanner.close();
}
}

0 comments on commit 280cb2c

Please sign in to comment.