Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

4. Make recommendations on steps to take to melt the glass ceiling.

Answered: 1 week ago

Question

1. Discuss the potential legal issues that relate to training.

Answered: 1 week ago

Question

3. Design a program for preparing for cross-cultural assignments.

Answered: 1 week ago