subject

1. Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just one statement. Hint: Call FindMax() twice in an expression. Sample program:
double FindMax(double num1, double num2) {
double maxVal = 0.0;
if (num1 > num2) { // if num1 is greater than num2,
maxVal = num1; // then num1 is the maxVal.
} else { // Otherwise,
maxVal = num2; // num2 is the maxVal.
}
return maxVal;
}

int main() {
double numA = 5.0;
double numB = 10.0;
double numY = 3.0;
double numZ = 7.0;
double maxSum = 0.0;

cout << "maxSum is: " << maxSum << endl;
return 0;
}
2. Define a function PrintFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. Ex: PrintFeetInchShort(5, 8) prints:
5' 8"
Hint: Use \" to print a double quote.
Sample program:
#include
using namespace std;

int main() {
PrintFeetInchShort(5, 8);
cout << endl;
return 0;
}
3. Complete the PrintTicTacToe function with char parameters horizChar and vertChar that prints a tic-tac-toe board with the characters as follows. End with newline. Ex: PrintTicTacToe('~', '!') prints:
x!x!x

x!x!x

x!x!x
Sample program:
#include
using namespace std;
void PrintTicTacToe(char horizChar, char vertChar) {

return;
}
int main() {
PrintTicTacToe('~', '!');
return 0;
}
4. Complete the PrintShape() function to print the following shape. End with newline.
Example output:
***
***
***
Sample program:
#include
using namespace std;
void PrintShape() {

return;
}
int main() {
PrintShape();
return 0;
}
5. Complete the function definition to print five asterisks when called once (do NOT print a newline). Output for sample program:

Sample program:
#include
using namespace std;
void PrintPattern() {

}
int main() {
PrintPattern();
PrintPattern();
cout << endl;
return 0;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
You know the right answer?
1. Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just one statement. Hi...
Questions
question
Mathematics, 25.11.2021 09:10
question
French, 25.11.2021 09:10
Questions on the website: 13722363