Question: AS stated in class: no modulus ( % ) operators!Create a simple math program that can tell if a large number is evenly divided by

AS stated in class: no modulus (%) operators!Create a simple math program that can tell if a large number is evenly divided by2 version 1: is the last string digit even (0,2,4,6,8) version 2: look at last bit and see if it is 03summing the digits until it is a single digitis the sum of all the digits 0,3,6, or 94Version 1is the last string digit even (0,2,4,6,8)divide by 2(convert to number, divide, return to string)is the new value even version 2look at last bit, is it 0bit shift leftis the last bit 0?version 3bit & 3-- this masks the last 2 bits...5Last string digit is "0" or "5"6last string digit is evendivides by 38Version 1is the last string digit even (0,2,4,6,8)divide by 2(convert to number, divide, return to string)is the new value even divide by 2(convert to number, divide, return to string)is the new value even version 2look at last bit, is it 0bit shift leftis the last bit 0?bit shift leftis the last bit 0?version 3are the last 3 bits 000-- this masks the last 3 bits ( not( bit & 7))9version 1is if divisible by 3(see above)divide by 3is the new result divisible by 3version 2using the algorithm for divide by 3, test to see if the final single digit string is 0 or 9 Each digit is 5 points maximum, See the Rubric for weights. Each digit should have its own function. (Reuse of code)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!