Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Please help me to write the code for #2 // Plurals // Set variable islands to iles // Set variable len to the size

image text in transcribed

C++

Please help me to write the code for #2

// Plurals // Set variable islands to "iles" // Set variable len to the size of the string country // Set variable last to the last two characters in country // If any of these are true // country starts with the value in islands. (use substr) OR // last is one of "es", "is","os", or "as" // Then set prefix to "les ". (space)

// Processing section /7 Country end in letter e or o? Feminine prefix-la (space) // Otherwise? Masculine prefix->le (space) // With these exceptions // Belize Cambodge Mexique Mozambique Zaire Zimbabwe Call le) // Starts with a vowel? prefix 1' (no space) /7 Plural? prefix is les (space) /7 Israel, Madagascar, Sri Lanka, Singapore, Monaco, // Cuba and Cyprus have no prefix string prefix; // Plurals // Set variable islands to "iles" // Set variable len to the size of the string country /7 Set variable last to the last two characters in country / If any of these are true / country starts with the value in islands. Cuse substr OR // last is one of "es", "is", "os", or "as" // Then set prefix to "les". (space) string islands"iles" string len-country.lengthO; string last country.substr(len - 2); if (country.substr(0, islands)islands Lastes' lastis' ll last == 'os* 11 last-"as') prefix - "les

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions

Question

R ( A , B , C , D ) FD: AB - > CD , C - > A , D - > B

Answered: 1 week ago

Question

What are the social tasks and challenges of adolescence?

Answered: 1 week ago