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, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
After you present a proposal, the committee starts asking you questions, some beyond the strict focus of your proposal. they ask questions about implications in other fields and knowledge about other fields. you are asked to redo your proposal. what is most likely missing? breadth of material depth of material clarity of material details of material
Answers: 1
question
Computers and Technology, 24.06.2019 00:50
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
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, 04.08.2021 22:00
question
Geography, 04.08.2021 22:00
question
History, 04.08.2021 22:00
Questions on the website: 13722361