1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ycow [4]
3 years ago
11

A Function checkMe takes three parameters, a character and two integers. If the sum of the two integers is negative, and the cha

racter has the value 'n', the function sets the integers to zero so that when the function returns, those integers have a zero value in the caller (main) program. Otherwise the function changes the character to a 'p' (so that it is changes in the caller), no matter what it started with! Give a SAMPLE CALL from main, a prototype and a function definition for this function.

Computers and Technology
1 answer:
Paul [167]3 years ago
7 0

Answer:

Check the explanation

Explanation:

Here is the program with function definition and two sample calls.

Code:

#include <iostream>

using namespace std;

//checkMe FUNCTION which takes values a, b and c

void checkMe(char &a, int &b, int &c)

{

//if sum of b and c is negative and a is 'n', b and c are set to 0, otherwise a is set to 'p'

if((b+c)<0 && a=='n')

{

b = 0;

c = 0;

}

else

{

a = 'p';

}

}

int main()

{

//first test case when else part is executed

char a = 'n';

int b = 5;

int c = 6;

 

checkMe(a, b, c);

 

cout<<a<<" "<<b<<" "<<c<<endl;

 

//second test case when if part is executed

a = 'n';

b = -4;

c = -5;

 

checkMe(a, b, c);

 

cout<<a<<" "<<b<<" "<<c<<endl;

return 0;

}

Kindly check the Output below:

You might be interested in
Which function prompts the user to enter information?
Rzqust [24]

Answer:

input() prompts the user to enter information

6 0
3 years ago
Read 2 more answers
What is logic gate? ​
Firdavs [7]
A logic gate is an idealized or physical device implementing a Boolean function; that is, it performs a logical operation on one or more binary inputs and produces a single binary output.
7 0
2 years ago
Read 2 more answers
A heart murmur is caused by incorrect operation of ________?​
Levart [38]

Answer:

the valves

Explanation:

science explains your questions answer. also did you know that the queen was an engineer in WWII? you probably did but you need 20 characters to submit an answere trust me it is the valves.

6 0
3 years ago
Name at least four factors that are looked at when a lender considers whether you are creditworthy.
emmasim [6.3K]
Sepa la verga cx I don't even know this
6 0
3 years ago
Which program, available on all operating systems, provides all types of information from a dns server and allows you to query a
JulsSmile [24]

The program Nslookup, is available on all operating systems and provides all types of information from a DNS server and allows you to query all types of information from a DNS server and change how your system uses DNS.

The network administration command-line tool nslookup can be used to verify that your DNS servers can resolve external domain names.

6 0
3 years ago
Other questions:
  • Which of the following is not a commodity?<br>A. Crude oil<br>B. Corn dogs<br>C. Cocoa<br>D. Coffee​
    10·2 answers
  • Game design is iterative. What does this mean?
    9·1 answer
  • Balance is the design principle that is represented when using the Crop tool?
    6·1 answer
  • Is there a syntax error in the following code? bool hourlyWorker = true; if (hourlyWorker) cout &lt;&lt; "The employee is an hou
    12·1 answer
  • All of these valid ways to earn money in microworkers except
    8·1 answer
  • Does anyone play genshin impact here?
    12·2 answers
  • What is the output?
    7·1 answer
  • Which of the following is NOT a function of a Web Browser?
    9·1 answer
  • Tim Berners-Lee cultivated a way to interconnect and self-index data. He made a major contribution to the development of the Int
    9·1 answer
  • Disadvantages of the divisional organization structure are _____. each division is able to operate independently from the parent
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!