Greetings, I am devising a project to compare user results to standard results. My algorithm wont run exactly the way I wish it would (scoring system) : The problem with my code is that it simply will not run in the way I wish it would. It will only read from the first "while" & "if" condition. It simply doesn't recognize the other conditions. The age and score will be provided from an external source, therefore this is just an algorithm/scoring system for the tool.

public class algorithm_tester {

int score;

int age;

public static void main(String[] args) {

int score = 0;

int age = 0;


while (age <30) {

if(score <15) {

System.out.println("Your Score Is Slightly Abnormal For Your Age.");

}

else if(score <10) {

System.out.println("Your Results Are Rather Low. Therefore, We Recommend You Seek Medical Advice.");

}

else if(score <8){

System.out.println("Your Results Suggest Severe Cognitive Impairment. You Must Seek Medical Attention Immediately.");

}

else {

System.out.println("Well Done! You Scored Very Well.");

}

while (age <40) {

if (score < 14) {

System.out.println("Your Results Are Slightly Abnormal For Your Age.");

}

else if(score < 10) {

System.out.println("We Recommend You Seek Medical Advice As Your Results Are Quite Low.");

}

else if(score <7) {

System.out.println("Your Score Is Very Low. We Believe You May Have Experienced Majoe Cognitive Impairment. We Recommend You Seek Immediate Medical Attention.");

}

else {

System.out.println("Well Done! You Have Shown No Evidence Cognitive Impairment");

}

while (age < 60) {

if (score < 12) {

System.out.println("Your Results Are Slightly Abnormal For Your Age.");

}

else if(score < 9) {

System.out.println("Your Score is Very Low. We Believe This Is Due To Minor Cognitive impairment. We Recommend You Seek Medical Advice.");

}

else if(score < 6) {

System.out.println("Your Results Have Led Us to Believe You Have Suffered Severe Cognitive Impairment. You Must Seek Medical Attention Immediately.");

}

else {

System.out.println("Congratulations! Your Results Were Excellent. You Have Shown No Evidence Of Cognitive Impairment");

}

while (age < 80) {

if (score < 10) {

System.out.println("Your Results Are Slightly Abnormal For Your Age.");

}

else if(score < 7) {

System.out.println("Your Score is Very Low. We Believe This Is Due To Minor Cognitive impairment. We Recommend You Seek Medical Advice.");

}

else if(score < 5) {

System.out.println("Your Results Have Led Us to Believe You Have Suffered Severe Cognitive Impairment. You Must Seek Medical Attention Immediately.");

}

else {

System.out.println("Congratulations! Your Results Were Excellent. You Have Shown No Evidence Of Cognitive Impairment");

}

while (age > 80) {

if (score < 10) {

System.out.println("Your Results Are Slightly Abnormal For Your Age.");

}

else if(score < 6) {

System.out.println("Your Score is Very Low. We Believe This Is Due To Minor Cognitive impairment. We Recommend You Seek Medical Advice.");

}

else if(score < 4) {

System.out.println("Your Results Have Led Us to Believe You Have Suffered Severe Cognitive Impairment. You Must Seek Medical Attention Immediately.");

}

else {

System.out.println("Congratulations! Your Results Were Excellent. You Have Shown No Evidence Of Cognitive Impairment");

}

}

}

}

}

}

}

}

