Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN C++ Words of Importance A former president wanted to make their mark by transforming the way we determine the importance of words by

image text in transcribed

CODE IN C++

Words of Importance A former president wanted to make their mark by transforming the way we determine the importance of words by emphasizing vowels including 'y'! When comparing two words, each word is given a weight. - A word receives three points every time a vowel is compared to a consonant. - A word receives one point when comparing two vowels or two consonants if its character is greater than the other in the traditional sense. - If one word has a vowel and the other has no character, then the word gets two points. - If one word has a consonant and the other has no character, then one point is added. - If both words have the same character, then no points are assigned. The word with the most points is more important. Write a function that takes in two C-Strings and returns 1 if the first word is more important than the second and returns 2 if the second word is more important and returns 0 otherwise. Examples - morelmportant("eel", "the") returns 1. - morelmportnat("the", "eel") returns 2. - morelmportant("angelic", "mistrust") returns 2. - morelmportant(spy", "ill") returns 1. - morelmportant("ill", "spy") returns 2. - morelmportant(trust", "silly") returns 2. - morelmportant("see", "sea") returns 1. Note: this is case insensitive comparison. The toupper() and tolower() functions can help

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_2

Step: 3

blur-text-image_3

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

Be familiar with the different perspectives of service quality.

Answered: 1 week ago

Question

Describe key customer feedback collection tools.

Answered: 1 week ago

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago