Question: a full step by step code with execution.. Assignment Portion - hand in once completed 4 for Via casha 5 for Master casdi. 37 for

Assignment Portion - hand in once completed 4 for Via casha 5 for Master casdi. 37 for American Fuperss cards. 6 for Disconer cardi In 1954. Han Luhe of itsM proposed an algonitien for validaring credit card Cutin sherk or the Mar to ahey, which ran le described as forlows (for illustra: 1. Dosble every second digit frum righe solef. If dowling of a dipit ierulta in a 2. Now add all singledigit numbers frum Siep 1. 4+4+8+2+3+1+7+8=37 3. Add all digits in the odd places from night io left in the carf number. 6+6+0+8+0+7+8+3=38 4. Sum the revaltu frum Siep 2 and Suep 3 . 37+38=75 5. If the resule from Siep 4 is drivible by 10 , the cand aumber is valid; otherwise, it is invalid, For example, the number 4365576018402626 is invalid, but the namber 4385576018410707 is valid. Wrise a program that prompts the wher to eater a crafit canf aumber as a lang integer. Displey whether the sumber is valid er invalid. Design your program to use the following methode: IN Parturn troe if the card nunber 14 vallid : f priblic statife boolem isvalidtlang nunber) for Oet. the ravit froe Stap z=f public static int sunofocubi efvenplace (tong nunber) in feturn this nuber if it is a single digit. ofbareise. *return the sun of the two digita if piblic otatie int getbigit (int nubber) 1 i*: Return suin of odd-place digits in nuaber."/ pubile statie int sueoroddplace (long nuaber) 1.* Muturn true it the nober a is a prefis for nueber "I publie static boolean prefixhatched(leng nuaber, int d) f.. Heturn the nunter of digite in a "f publie static int getsize(tong d) For Molum the first k nusber of diaits froe nantier. If the - nuaber of aigits is mabeer is Tesis than k, return niaber. if publie static long getprefix(long number, int k ) Here are ample fuas of the programe (You may also inplement this program by reading the input as a atring and processiag the Mring to validate the credit cardi) Enter a credit card nubber as a long tateger
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
