Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Assignment 2

samsnelling
samsnelling 


Credit Card Validator, File Input & String Processing, Password Validator, using Dr. Java using: Long integers if statements input validation using Scanner "has" methods Loops (while, do-while, for) File input using Scanner Class String processing Due before midnight oct 23, 2013 Attachments Tags
Clarifications

Answers

Answer

mariobeka
mariobeka 



Answer for 1 & 2 Attachments
AscendingWords.java (1 K) Download Preview
Scanner inputFile = new Scanner(new File("dictionary.txt")); while (inputFile.hasNextLine()) { theWord = inputFile.nextLine(); if(isAscending(theWord)){ System.out.println(theWord); countAsc++; } if (theWord.length() > longestWord.length()) longestWord = theWord; countWords++; sum = sum + theWord.length() ; } double

CreditCardValidator.java (2 K) Download Preview
10; } return digits; } // sum even places from right to left // doubling every 2nd place from right // save sum of doubled numbers private static int sumEvenPlaces(int[] digits) { int sum = 0; for (int i = 0; i < digits.length; i += 2) { int doubledValue

CreditCardValidator.txt (1 K) Download Preview
5048480142296497 Checksum is 80 Card number is valid. Enter a 16-digit credit card number: something different Input of something different is not valid. Enter a 16-digit credit card number: 0000addddaddd Input of addddaddd

AscendingWords.txt (1 K) Download Preview
words. Average word length

Screenshots
Purchase Answer