diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index c4b8437..7e94167 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,9 +5,9 @@
-
-
+
+
@@ -64,6 +64,7 @@
"Application.EnhancedSwitches.executor": "Run",
"Application.Main.executor": "Run",
"Application.TempConverter.executor": "Run",
+ "Application.WhileLoops.executor": "Run",
"Application.compountInterest.executor": "Run",
"Application.ifStatements.executor": "Run",
"Application.madLibs.executor": "Run",
@@ -120,7 +121,7 @@
-
+
@@ -274,7 +275,15 @@
1767839480914
-
+
+
+ 1767840813715
+
+
+
+ 1767840813715
+
+
diff --git a/out/production/java_practice/WhileLoops.class b/out/production/java_practice/WhileLoops.class
new file mode 100644
index 0000000..a81720c
Binary files /dev/null and b/out/production/java_practice/WhileLoops.class differ
diff --git a/practice_projects/src/WhileLoops.java b/practice_projects/src/WhileLoops.java
new file mode 100644
index 0000000..d32f932
--- /dev/null
+++ b/practice_projects/src/WhileLoops.java
@@ -0,0 +1,46 @@
+import java.util.Scanner;
+
+public class WhileLoops {
+
+ public static void main(String[] args){
+
+ Scanner scanner = new Scanner(System.in);
+
+ String name = "";
+
+ // Get users name
+ while(name.isEmpty()){
+ System.out.print("Enter your name: ");
+ name = scanner.nextLine();
+ }
+
+
+
+ // get users age
+ int age = 0;
+
+ do{
+ System.out.println("Enter your age: ");
+ System.out.println("(Your age can't be negative)");
+ age = scanner.nextInt();
+
+ }while(age < 0);
+
+ // Greet them
+ System.out.printf("Hello %s. You are %d years old!\n", name, age);
+
+
+ // ask a user to enter a number between 1 - 10;
+ int number = 0;
+ do{
+ System.out.print("Enter a number between 1-10: ");
+ number = scanner.nextInt();
+
+
+ } while(number < 1 || number > 10);
+
+ System.out.printf("Wow %s. You picked %d", name, number);
+
+ scanner.close();
+ }
+}