aneliabogeva

VolwesSum

Dec 13th, 2020
336
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class VolwesSum {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         String text = scanner.nextLine();
  7.         Integer value = 0;
  8.  
  9.         for(int i = 0; i < text.length(); i++){
  10.             char letter = text.charAt(i);
  11.  
  12.             switch (letter){
  13.                 case 'a':
  14.                     value += 1;
  15.                     break;
  16.                 case 'e':
  17.                     value += 2;
  18.                     break;
  19.                 case 'i':
  20.                     value += 3;
  21.                     break;
  22.                 case 'o':
  23.                     value += 4;
  24.                     break;
  25.                 case 'u':
  26.                     value += 5;
  27.                     break;
  28.                 default:
  29.                     break;
  30.  
  31.             }
  32.         }
  33.         System.out.println(value);
  34.     }
  35. }
  36.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×