Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ZipCode {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- System.out.println("what's your zip code?");
- String input = scan.nextLine();
- System.out.print("|");
- int checkerTotal = 0;
- for(int i = 0; i < 5; i++){
- int checker = input.charAt(i);
- if(input.charAt(i) == '0'){
- System.out.print("||:::");
- }
- if(input.charAt(i) == '1'){
- System.out.print(":::||");
- }
- if(input.charAt(i) == '2'){
- System.out.print(":::||");
- }
- if(input.charAt(i) == '3'){
- System.out.print("::|||");
- }
- if(input.charAt(i) == '4'){
- System.out.print(":|:::");
- }
- if(input.charAt(i) == '5'){
- System.out.print(":|:|:");
- }
- if(input.charAt(i) == '6'){
- System.out.print(":||::");
- }
- if(input.charAt(i) == '7'){
- System.out.print("|::::");
- }
- if(input.charAt(i) == '8'){
- System.out.print("|::||");
- }
- if(input.charAt(i) == '9'){
- System.out.print("|:|::");
- }
- checkerTotal = checkerTotal + checker;
- }
- if(checkerTotal % 10 == 0){
- System.out.print("||:::");
- }
- if(checkerTotal % 10 == 9){
- System.out.print(":::||");
- }
- if(checkerTotal % 10 == 8){
- System.out.print(":::||");
- }
- if(checkerTotal % 10 == 7){
- System.out.print("::|||");
- }
- if(checkerTotal % 10 == 6){
- System.out.print(":|:::");
- }
- if(checkerTotal % 10 == 5){
- System.out.print(":|:|:");
- }
- if(checkerTotal % 10 == 4){
- System.out.print(":||::");
- }
- if(checkerTotal % 10 == 3){
- System.out.print("|::::");
- }
- if(checkerTotal % 10 == 2){
- System.out.print("|::||");
- }
- if(checkerTotal % 10 == 1){
- System.out.print("|:|::");
- }
- System.out.print("|");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment