Tut1q1

School: University of Waterloo - Course: CS 116 - Subject: Accounting

import check def create_acct_num(n): ''' consumes a positive 3 digit number and returns a new 4 digit number where the first 3 digits are n and the last digit is the remainder of the sum of all the numbers of n when divided by 7 create_actt_num: Nat -> Nat Requires: n < 1000 ''' w = n % 10 x = (n // 10) % 10 y = n // 100 z = (w + x + y) % 7 return (n * 10) + z ##Examples: check.expect("Example 1", create_acct_num(778), 7781)

Expert's Answer

Related Assignment Questions

.

Chat with our Experts

Want to contact us directly? No Problem. We are always here for you

Your future, our responsibilty submit your task on time.

Order Now

Need Urgent Academic Assistance?

Get Professional Help at Low Prices!

*
*
*


*

TOP
Order Notification

[variable_1] from [variable_2] has just ordered [variable_3] Assignment [amount] minutes ago.