由于扫描仪,我不知道如何将其转换为流程图。
import java.util.Scanner;
import java.io.*;
public class Voter {
public static void main(String [] args) {
System.out.print("Enter your age: ");
int age = new Scanner(System.in).nextInt();
if (age >= 18) {
System.out.print("You are eligible to vote");
}
else {
System.out.print("Nah, you're not allowed to vote");
}
}
}