Question: C++ Write functions as described below. Each function is just a few lines long. Pay attention to the types of the parameters and the types

C++

Write functions as described below. Each function is just a few lines long. Pay attention to the types of the parameters and the types being returned. Write testing code to test each function, testing them in the order they are described below.

int maxIntVal(int x, int y) {

//returns the largest of x and y

your code here

}

int sumN(int n) {

//returns the sum of the integers from 1 to n; assume n >= 0

your code here

}

bool isEven(int n) {

//returns true if n is an even number, false otherwise

}

string fixCaps(string s) {

//returns the string with the first letter capitalized and the rest of the

//letters lowercased

}

void toLowerCase(string &s) {

//modifies s so that it is all lowercase; this is a pass by reference

}

int xToY(int x, int y) {

//uses a loop to calculate x^y and return it; assume y >= 0

}

bool isAllCaps(string s) {

//return true if s is all capital ASCII letters, false otherwise

}

void toProperCaps(string &s) {

//modifies s so that the first character and any other characters which are

//after a blank are capitalized, all other letters are lowercased. This is a

//pass by reference.

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!