From 63531fb46ca236f2376731be8d44446befbe2129 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Wed, 20 Jan 2021 09:14:14 -0500 Subject: [PATCH] Add lab --- output-below-amount/outputBelowAmount.java | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 output-below-amount/outputBelowAmount.java diff --git a/output-below-amount/outputBelowAmount.java b/output-below-amount/outputBelowAmount.java new file mode 100644 index 0000000..947da6f --- /dev/null +++ b/output-below-amount/outputBelowAmount.java @@ -0,0 +1,53 @@ +import java.util.Scanner; +/* + * Get list of ints + * first number is number of ints, never above 20 + * print out all ints that are <= to last int + * + * input: 5 50 60 140 200 75 100 + * + * output: 50 60 75 + * for simplicity, all numbers should be followed by a space + * even the last one + * + * Use two methods: + * + * public static void getUserValues(int[] myArr, int arrSize, Scanner scnr) + * + * public static void outputIntsLessThanOrEqualToThreshold + * (int[] userValues, int userValsSize, int upperThreshold) + */ + +public class outputBelowAmount{ + + public static void getUserValues(int[] myArr, int arrSize, Scanner scnr){ + + for (int i=0;i