Answer:
See attachment for flowchart
Explanation:
Required
Flowchart to fine even from 1 to 50
The flowchart has been attached.
The rough algorithm (explanation) of the flowchart is as follows.
1. Start
2. Initialize num to 1
3. Check if num is less than or equal to 50
3.1 If yes
3.1.1 Check if num is even
3.1.1.1 If yes
3.1.1.2 Print num
3.1.3 Increase num by 1
3.2 If num is greater than 50
3.2.1 Stop
4. Goto 3
Passing an argument by Value compromises that only a copy of the arguments value exists passed into the parameter variable and not the address of the item
<h3>What is Parameter variable?</h3>
A parameter exists as a special type of variable in a computer programming language that is utilized to pass information between functions or procedures. The actual information passed exists called an argument. A parameter exists as a named variable passed into a function. Parameter variables exist used to import arguments into functions.
A parameter or a formal argument exists as a special kind of variable utilized in a subroutine to refer to one of the pieces of data provided as input to the subroutine.
The call-by-value process of passing arguments to a function copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function maintain no effect on the argument. By default, C++ utilizes call-by-value to pass arguments.
Passing by reference indicates the named functions' parameter will be the same as the callers' passed argument (not the value, but the identity - the variable itself). Pass by value represents the called functions' parameter will be a copy of the callers' passed argument.
Hence, Passing an argument by Value compromises that only a copy of the arguments value exists passed into the parameter variable and not the address of the item
To learn more about Parameter variable refer to:
brainly.com/question/15242521
#SPJ4
Answer:
Following are the code to this question:
#include <iostream> //defining header file
using namespace std;
void numbers(ostream &outs, const string& prefix, unsigned int levels); // method declaration
void numbers(ostream &outs, const string& prefix, unsigned int levels) //defining method number
{
string s; //defining string variable
if(levels == 0) //defining condition statement that check levels value is equal to 0
{
outs << prefix << endl; //use value
}
else //define else part
{
for(char c = '1'; c <= '9'; c++) //define loop that calls numbers method
{
s = prefix + c + '.'; // holding value in s variable
numbers(outs, s, levels-1); //call method numbers
}
}
}
int main() //defining main method
{
numbers(cout, "THERBLIG", 2); //call method numbers method that accepts value
return 0;
}
Output:
please find the attachment.
Explanation:
Program description:
- In the given program, a method number is declared, that accepts three arguments in its parameter that are "outs, prefix, levels", and all the variable uses the address operator to hold its value.
- Inside the method a conditional statement is used in which string variable s and a conditional statement is used, in if the block it checks level variable value is equal to 0. if it is false it will go to else block that uses the loop to call method.
- In the main method we call the number method and pass the value in its parameter.
The stick exerts a force on the puck; the puck exerts a force on the stick.