micher43

P8.3 ZIPCODE THINGAMABOBBER

Nov 21st, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.89 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class ZipCode {
  5.  
  6.     public static void main(String[] args) {
  7.        
  8.         Scanner scan = new Scanner(System.in);
  9.         System.out.println("what's your zip code?");
  10.         String input = scan.nextLine();
  11.        
  12.        
  13.         System.out.print("|");
  14.        
  15.         int checkerTotal = 0;
  16.        
  17.         for(int i = 0; i < 5; i++){
  18.            
  19.             int checker = input.charAt(i);
  20.            
  21.             if(input.charAt(i) == '0'){
  22.                 System.out.print("||:::");
  23.             }
  24.            
  25.             if(input.charAt(i) == '1'){
  26.                 System.out.print(":::||");
  27.             }
  28.            
  29.             if(input.charAt(i) == '2'){
  30.                 System.out.print(":::||");
  31.             }
  32.            
  33.             if(input.charAt(i) == '3'){
  34.                 System.out.print("::|||");
  35.             }
  36.            
  37.             if(input.charAt(i) == '4'){
  38.                 System.out.print(":|:::");
  39.             }
  40.            
  41.             if(input.charAt(i) == '5'){
  42.                 System.out.print(":|:|:");
  43.             }
  44.            
  45.             if(input.charAt(i) == '6'){
  46.                 System.out.print(":||::");
  47.             }
  48.            
  49.             if(input.charAt(i) == '7'){
  50.                 System.out.print("|::::");
  51.             }
  52.            
  53.             if(input.charAt(i) == '8'){
  54.                 System.out.print("|::||");
  55.             }
  56.            
  57.             if(input.charAt(i) == '9'){
  58.                 System.out.print("|:|::");
  59.             }
  60.            
  61.             checkerTotal = checkerTotal + checker;
  62.                            
  63.         }
  64.        
  65.    
  66.         if(checkerTotal % 10 == 0){
  67.             System.out.print("||:::");
  68.         }
  69.        
  70.         if(checkerTotal % 10 == 9){
  71.             System.out.print(":::||");
  72.         }
  73.        
  74.         if(checkerTotal % 10 == 8){
  75.             System.out.print(":::||");
  76.         }
  77.        
  78.         if(checkerTotal % 10 == 7){
  79.             System.out.print("::|||");
  80.         }
  81.        
  82.         if(checkerTotal % 10 == 6){
  83.             System.out.print(":|:::");
  84.         }
  85.        
  86.         if(checkerTotal % 10 == 5){
  87.             System.out.print(":|:|:");
  88.         }
  89.        
  90.         if(checkerTotal % 10 == 4){
  91.             System.out.print(":||::");
  92.         }
  93.        
  94.         if(checkerTotal % 10 == 3){
  95.             System.out.print("|::::");
  96.         }
  97.        
  98.         if(checkerTotal % 10 == 2){
  99.             System.out.print("|::||");
  100.         }
  101.        
  102.         if(checkerTotal % 10 == 1){
  103.             System.out.print("|:|::");
  104.         }
  105.        
  106.                
  107.         System.out.print("|");
  108.            
  109.     }
  110.  
  111. }
Advertisement
Add Comment
Please, Sign In to add comment