1. Homepage
  2. Homework
  3. UM-SJTU VG101 22SU - Homework2 - Smith Number

UM-SJTU VG101 22SU - Homework2 - Smith Number

Engage in a Conversation
This question has been solved

Problem 5 CourseNana.COM

Write a function isSmithNum which takes one real number from the users and return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at Smith number. A Smith number must be positive and have more than one factor. CourseNana.COM


CourseNana.COM

Note: Include at least one more subfunction to decompose your problem. CourseNana.COM

Examples: CourseNana.COM

# example 1 CourseNana.COM

Input: isSmithNum(4) CourseNana.COM

Output: true CourseNana.COM

# example 2 CourseNana.COM

Input: isSmithNum(265) CourseNana.COM

Output: true CourseNana.COM

# example 3 CourseNana.COM

Input: isSmithNum(5) CourseNana.COM

Output: false CourseNana.COM

# example 4 CourseNana.COM

Input: isSmithNum(pi) CourseNana.COM

Output: false CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Matlab代写,Matlab代编,Matlab代考,Matlabhelp,Matlab作业代写,Matlab编程代写,Matlabprogramming help,Matlabassignment help,Matlabsolution,