Create two functions transform(string, int) and transform(string). transform(string, int) - returns the sum of all the character's
Fantastic news! We've Found the answer you've been seeking!
Question:
Create two functions transform(string, int) and transform(string).
transform(string, int) - returns the sum of all the character's ASCII values. transform(string) - returns the reverse of the string.
In the main function, create a program that accepts string user input and checks for the following condition:
• If the first letter of the string is a vowel, call the transform function and pass in the string.
Otherwise if the first letter of the string is consonant, call the transform function and pass in both the string and its length.
Assign the value to a variable and print it.
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date: