Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with C++ the answers is not coming out to true or false and its printing out the numbers. Code: #include using namespace

I need help with C++ the answers is not coming out to true or false and its printing out the numbers.

image text in transcribed

image text in transcribed

Code:

#include using namespace std;

bool isLetter(char letter); bool isNumber(char num); void capitalize(char& letter); void spaceToComma(string& list); bool first10Last(int data[], int size); bool equalFirstLast(int array[], int size); void printArray(int array[], int size); void arrayPlus2(int array[], int size); void squareArray(int array[], int size);

bool isLetter(char letter) { int c=letter;

if((c>=65 && c=97 && c

bool isNumber(char num) { int n=num;

if(n>=48 && n

void capitalize(char& letter) { int c=letter; if(c>=97 && c

void spaceToComma(string& list) { int c=0;

for( ; list[c]!='\0'; c++) { if(list[c]==' ') list[c]=','; }

}

bool first10Last(int data[], int size) { if(data[0]==10) return true; else if(data[size-1]==10) return true; else return false; }

bool equalFirstLast(int array[], int size) { if(size>=1 && array[0]==array[size-1]) return true; else return false; }

void printArray(int array[], int size) { cout

}

void arrayPlus2(int array[], int size) { for(int i=0; i

void squareArray(int array[], int size) { for(int i=0; i

int main() { int result; bool answer; string value;

cout

cout

cout

cout

cout

cout

cout

cout

cout

return 0;

}

Testing is Letter Should be true: 1 Should be true: 1 Should be false: 0 Testing is Number Should be false: 0 Should be true: 1 Testing capitalize Should print A: A Should print A: A Testing space ToComma Should be cats, hats,bats. cats, hats, bats Should be I, love, cookies. I, love, cookies ***Testing first 10Last Should print true: 1 Should print true: 1 Should print false: 0 Testing equalFirstLast Should be false: 0 Should be true: 1

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

4. Describe phases of majority identity development.

Answered: 1 week ago

Question

KEY QUESTION Refer to the table in question

Answered: 1 week ago