Write a C++ program which declares a 5 x 10 characterarray, prompts the user to enter string literals (consisting of only alphabets) into this array and counts the value of each string (row). For counting value of strings, assume a/A=1, b/B=2.....z/Z=26. For instance, if the string at row 0 is ‘hello’, it’s value should be calculated as (h = 8) + (e = 5) + ( l = 12) + (l = 12) + (o = 15) = 52. Once the values have been calculated, your program should print the string with the highest value on screen.
Write a C++ program which declares a 5 x 10 characterarray, prompts the user to enter string literals (consisting of only alphabets) into this array and counts the value of each string (row). For counting value of strings, assume a/A=1, b/B=2.....z/Z=26. For instance, if the string at row 0 is ‘hello’, it’s value should be calculated as (h = 8) + (e = 5) + ( l = 12) + (l = 12) + (o = 15) = 52. Once the values have been calculated, your program should print the string with the highest value on screen.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 3PE
Related questions
Question
Write a C++
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning