Question: 1)Write a C++ if expression for the following statement: If x is less than or equal to 10 or y is less than or equal

1)Write a C++ if expression for the following statement:

If x is less than or equal to 10 or y is less than or equal to 10.

2) The following program uses the switch case programming structure (substitute for if and if-else). Fill in the blanks with what is missing.

#include

#include

using namespace std;

int main()

{

double y =10;

double x = 5;

double z;

z= pow(x,2) + pow(y,2);

switch(______) // Write in the blank what needs to go to compare z to various numbers.

{

case______: // If z = 150

cout << z = 1 << endl;

break;

case:______:_ // else if z = 200

cout << z = 20 << endl;

break;

case:_______:_//else if z= 300

cout << z = 125 << endl;

break;

case:________:// else z = 400

cout << z = 200 << endl;

break;

}

return 0;

}

3)In the following program, in which the arguments are passed by reference, what are the final values of x and y that will be displayed in the cout statement? .

#include .

using namespace std;

void function( int&, int&);

int main()

{

int x = 0; .

int y = 0;

function(x,y)

cout<< x = << x << y = << y<< endl;

return 0;

}

void function( int& q , int& r )

{

q=35

r=240

cout << this is a small function. ;

}

a. .x =

b. .y=

4) Determine whether or not the names below are valid:

a. 3%599_____________________

b. livingasteroids__________________

c. Canniptioner______________

d. 12Fits=a caniption_______________

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 Databases Questions!