Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.tutorial;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner userInput = new Scanner(System.in);
- char huruf;
- System.out.println("\n\t Menentukan Huruf Vokal atau Huruf Konsonan \n");
- System.out.print(" Inputkan Hurufnya : ");
- huruf = userInput.next().charAt(0);
- if (huruf == 'a' || huruf == 'i' || huruf == 'u' || huruf == 'e' || huruf == 'o') {
- System.out.println("\n" + huruf + " adalah huruf VOKAL");
- }
- else {
- System.out.println("\n" + huruf + " adalah huruf KONSONAN");
- }
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement