Answer:
B. installApplication(‘A’, 1);
Explanation:
Given
The above code segment
Required
The correct call to installApplication
The function installApplication is declared as void, meaning that it is not expected to return anything.
Also, it receives a character and an integer argument.
So, the call to this function must include a character and an integer argument, in that order.
Option D is incorrect because both arguments are integer
Option C is incorrect because it passes no argument to the function.
Option A is incorrect because it receives an integer value from the function (and the function is not meant not to have a return value).
Option B is correct
Answer:
Following are the code to the given question:
#include <iostream>//header file
using namespace std;
int NumberOfPennies(int ND, int NP=0)//defining a method that accepts two parameters
{
return (ND*100 +NP);//use return keyword that fist multiply by 100 then add the value
}
int main() //main method
{
cout << NumberOfPennies(5,6) << endl; // Should print 506
cout << NumberOfPennies(4) << endl; // Should print 400
return 0;
}
Output:
506
400
Explanation:
In the method "NumberOfPennies" it accepts two parameters that are "ND and NP" that uses the return keyword that multiply 100 in ND variable and add in NP variable and return its values.
In the main method it it uses the cout method that call the by accepts value in parameter and print its value.
Answer:
Explanation:
Algorithm design is the branch of discrete mathematics and computer science that deals with the research, development and implementation of sequential and asynchronous algorithms. ... An algorithm is simply a sequence of instructions; a recipe is an algorithm, and so is a list of driving instructions.