Question
# Write a JES function named 'sumOfStudentDigits' that will display the sum of # the digits of YOUR 7-digit student number e.g s1234567.(No need to
# Write a JES function named 'sumOfStudentDigits' that will display the sum of # the digits of YOUR 7-digit student number e.g s1234567.(No need to store the s). You must store the # individual digits in 7 separate variables and then use # the variables for the calculation. There is no need to take user inputs. # # E.g. if the student number is s1234567, the first variable must # store 1, the second must contain 2, etc. Finally, when the # variables are added, the answer should be 28 # (as 1+2+3+4+5+6+7 is 28) and your function should display: # >>> The sum is 28
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
# Write a JES function named 'greetUser' that will display an # introductory greeting for a username entered via the keyboard. The # username input must be taken using the 'requestString' function # (see JES Functions menu->Input/Output). # E.g. if the entered username is s1234567, it should display: # >>> Hello s1234567! The system is ready... # # Tip 1: The above example is only an example. I.e. if a different # username is entered, the message should alter accordingly. # Tip 2: You _do not_ need to validate the input (e.g. to see if # there are no spaces, etc.).
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
# Write a JES function named 'sumOfDigitsAdvanced' that will take any # number (no s ) as a single input from the keyboard (tip: tricky) and then # perform the same calculation that you did in task 1. The number # can have any number of digits. # Hint 1: Assume all characters are numerical digits.
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started