Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Language : C++ Write the functions using code provided IsVowel() Function: IsVowel Input: strIn as string If first character of strIn is a, e,

Programming Language : C++

Write the functions using code provided

IsVowel()

Function: IsVowel Input: strIn as string If first character of strIn is a, e, i, o, or u (upper or lower case) then Return true Else Return false End if

PigVowel

Function: PigVowel Input: strIn as string Set strOut = strIn If the last character of strIn is y then Append ay to strOut Else Append yay to strOut End if Return: strOut

PigConsonant

Function: PigConsonant Input: strIn as string Set strOut = strIn from 2nd character of strIn to last character or strIn Append first character of strIn to strOut Append ay to strOut Return: strOut

The main function will:

Store input in strInput If strInput is vowel strOutput is set by PigVowel Else strOutput is set by PigCononant End if Display strOutput

-----------------------------------------------------------------------------------------

#include "stdafx.h"

#include

#include

#include

using namespace std;

bool IsVowel(string strIn)

{

if (strIn.length() > 0)

{

char c;

c = toupper(strIn[0]);

if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U')

return true;

}

return false;

} string PigVowel(string strIn)

{

string strOut; return strOut;

} string PigConsonant(string strIn)

{

string strOut;

return strOut;

}

int _tmain(int argc, _TCHAR* argv[])

{ string strInput = "";

int iPosition = 0;

string strOutput = "";

cout << "Pig Latin Interpreter" << endl << endl;

cout << "Enter a word in English: ";

cin >> strInput; cout << endl;

cout << "Pig Latin: " << strOutput << endl << endl; system("Pause");

return 0;

}

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

More Books

Students also viewed these Databases questions

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago

Question

Explain the testing process of accounting 2?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago