Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

Explain the importance of setting goals.

Answered: 1 week ago

Question

Define induction and what are its objectives ?

Answered: 1 week ago

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago