Computers and Technology, 24.03.2020 17:01 lescoto9035
Create the strAnalysis() function that takes 1 string argument and returns a string message. The message will be an analysis of a test string that is passed as an argument to strAnalysis(). The function should respond with messages such as:
"big number"
"small number"
"all alphabetic"
"multiple character types"
The program will call str_analysis() with a string argument from input collected within a while loop. The while loop will test if the input is empty (an empty string "") and continue to loop and gather input until the user submits at least 1 character (input cannot be empty).
The program then calls the str_analysis() function and prints the return message.
Sample input and output:
enter nothing (twice) then enter a word
enter word or integer:
enter word or integer:
enter word or integer: Hello
"Hello" is all alphabetical characters!
alphabetical word input:
enter word or integer: carbonization
"carbonization" is all alphabetical characters!
numeric inputs:
enter word or integer: 30
30 is a smaller number than expected
enter word or integer: 1024
1024 is a pretty big number
loop until non-empty input is submitted
Once the user gives input with characters use the input in calling the str_analysis() function.
Additional Details:
In the body of the str_analysis() function:
Check if string is digits
if digits: convert to int and check if greater than 99
if greater than 99 print a message about a "big number"
if not greater than 99 print message about "small number"
check if string isalpha then (since not digits)
if isalpha print message about being all alpha
if not isalpha print a message about being neither all alpha nor all digit
call the function with a string from user input
Run and test your code before submitting
# [ ] create, call and test the str_analysis() function
Answers: 2
Computers and Technology, 21.06.2019 20:30
Write 150 words on what kind of website would you like to make in the future? what sites would you like to model yours after?
Answers: 2
Computers and Technology, 22.06.2019 00:20
What’s resistance in an electrical circuit ?
Answers: 1
Computers and Technology, 24.06.2019 01:00
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
Computers and Technology, 24.06.2019 11:20
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput.find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
Create the strAnalysis() function that takes 1 string argument and returns a string message. The mes...
Computers and Technology, 19.03.2021 03:30
Physics, 19.03.2021 03:30
Mathematics, 19.03.2021 03:30
Social Studies, 19.03.2021 03:30
Health, 19.03.2021 03:30
Mathematics, 19.03.2021 03:30