ANSWER :
Arguments are in order : char , int &, string &, int, string
so option 4 is the correct way of calling this function
findCandidate('m',age,name,7,"B.Curr");
CODE :
#include <iostream>
using namespace std;
// A dummy function to check function call and arguments it
takes
int find_candidate(char a,int & agep, string &namep,int
year, string quali)
{
cout<<a<<endl;
cout<<&agep<<endl;
cout<<&namep<<endl;
cout<<year<<endl;
cout<<quali;
return 0;
}
int main()
{
string name="name";
int age = 12;
//calling the function
find_candidate('m',age,name,7,"b.com");
return 0;
}

OUTPUT :
You can see in this way, the function is being called without any error .

THANK YOU.....!!!!
Suppose the following declarations appear in the mainfunction of a C++ program: string name, qualification; char...
2 COS1511 MAY/JUNE2020 SECTION A 20 MARKS Choose one option for every question. If, for example you choose option 2 as the correct answer for Question 1, and option 4 as the correct answer for Question 2, please answer as follows: 1. 2 2.4 etc. QUESTION 1 2 marks Suppose the following declarations appear in the nai nfunction of a C++ program: string nane, course; char sex; int age; float cost; bool approved; If the following function header is given:...
Suppose the following declarations appear in the mainfunction of a C++ program: string name, course, date; float cost; bool approved; Suppose the following calling statement appears in the mainfunction: approveFunds ("Memory enhancement", "Ellen Subisa", date, 595.00, approved); Which of the options below is a correct function header of the function approve Fundsin the main function? 1. void approveFunds (string course, string name, string & date, float coste, bool & approved) 2. void approveFunds (string & course, string & name, string...
QUESTION 3 2 marks Suppose the following declarations appear in the nai nfunction of a C++ program: string nane, course, date; float cost; bool approved; Suppose the following calling statement appears in the nai nfunction: approveFunds("Menory enhancement", "Ell en Subi sa", date, 595.00, approved): Which of the options below is a correct function header of the function approveFunds in the main function? 1. void approveFunds(string coursep, string namep, string & dat ep, float cost P, bool & approved) 2. void...
Part1. Write a C program contains the following declarations: char customer_name[N_CUSTOMERS][MAX_NAME_LENGTH]; int customer_number[N_CUSTOMERS] A program uses a text file that contains the following data on each line: The customer number is an int, and the first and last names are alphabetic strings that contain no whitespace. The last and first names themselves are however separated by whitespace. Write a C function with the following prototype: void read_customer (char name[][MAX_NAME_LENGTH], int number[], int position, FILE *cust_file) Your function should read a...
Given the following program: #include <stdio.h> struct student { int id; char name[20]; char grade; }; void func(struct student stud); int main() { struct student astud; astud.id=9401; strcpy(astud.name, "Joe"); astud.grade = 'A'; func(astud); return 0; } Abdelghani Bellaachia, CSCI 1121 Page: 16 void func(struct student astud) { printf(" Id is: %d \n", astud.id); printf(" Name is: %s \n", astud.name); printf(" Grade is: %c \n", astud.grade); } Modify this program to include the address of a student as a separate structure....
C programming The program will require the following structure: struct _data { char *name; long number; }; The program will require command line arguments: int main(int argv, char **argc) { Where argv is the number of arguments and argc is an array holding the arguments (each is a string). Your program must catch any case where no command line arguement was provided and print a warning message (see below). You MUST include/use the following functions, defined as follows: int SCAN(FILE...
#include <iostream>
#include <string>
using namespace std;
void get_user_string(string *);
string convert_to_dash(String* );
int_search_and_replace(char, string, string
&);
int main (){
string s;
cout << "Enter a string:" << endl;
get_user_string(&s);
string dash_version =
convert_to_dash(&s)
if ( dash_version != 32){
&s.push_back('-');
}
Here is an example operation of the completed program: Please enter a string: the weather is great! The dash-version of your string is: Please tell me the char that...
11. What is the output of the following program fragment? int v[5] = {10, 20, 30, 40, 50}; for (int i=3; i>0; i--) { cout << v[i] << " "; } A. 102030 B. 302010 C. 403020 D. 40302010 12. Given the following code: char a[20]; char b[30]; Copy(a, b); // Copy all elements of b into a What is the best signature (header) of the Copy function? A. void Copy(char x[], char y[]) B. void Copy(const char x[], char...
Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double number-25.0: int main) f int x-18, y-20; cout<c"Before: x- kex<" and y-eyecendl; Fundxy 1// end of main void Funcfint a, int b) int sum a+b; a-200; b-300; numberanumber+1.0 Which of the statements below are correct? (Select only the correct answers. There may be more than one) D A The statement double number-25.0; declares a global variable number B. The variables x and y are...
(Longest common prefix, C-string, loop, char comparison) Write the prefix function to find the longest prefix of two strings using C-strings with the following header: void prefix( const char s1[ ], const char s2[ ], char commonPrefix[ ]) Write a test program that prompts the user to enter two C-strings and displays their common prefix. Sample run :- String 1: Programming is fun String 2: Program logic The common prefix is program.