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
Formatting can be applied to
valkas [14]
Formatting can maybe be applied to software works
8 0
3 years ago
Read 2 more answers
What is the definition of Simplex transmission and Duplex Transmission?
ira [324]

Answer:

Alternatively referred to as simplex communication or simplex transmission, simplex is a one-way only communication standard that broadcasted information may only travel in one direction. This method is different than duplex transmission, which allows for two-way broadcasting. Examples of simplex include radio broadcasting, television broadcasting, computer to printer communication, and keyboard to computer connections.

Explanation:

computers

6 0
4 years ago
The person who suggested that the continents were once a supercontinent, called Pangaea, but slowly drifted apart was who
kherson [118]
Alfred Wegener was the one who came up with the Pangea.
3 0
3 years ago
Read 2 more answers
Technological improvements have allowed people to inhabit a wider variety of places more easily. Please select the best answer f
muminat

The statement ‘Technological improvements have allowed people to inhabit a wider variety of places more easily’ is true. Technology has made our lives easier and faster. You can just buy a land or house from the developer to obtain a place you want.

9 0
3 years ago
Read 2 more answers
Which of the following functions grows at a faster rate than the rest? (Points : 6)
ehidna [41]

Answer:

n2.

Explanation:

The function with the time complexity of n2 is the fastest growing function is in terms of square.As n increases the time complexity will grow very rapidly.

n=1   n2=1

n=2   n2=4

n=3   n2=9

n=4   n2=16

n=5   n2=25.

The slowest growing function among them is log n then n and then n log n.

n log n is better than n2.

4 0
3 years ago
Other questions:
  • Which best describes the difference between stocks and bonds ?
    8·2 answers
  • In which scenario would someone want to use the Paste Link option?
    7·1 answer
  • Tel me free english learning website?
    5·1 answer
  • One of the biggest changes to affect the internet will be the continuing adoption of a new version of the internet protocol, ver
    5·1 answer
  • What problems does the swim coach have? Use details from the story to support your answer.
    7·1 answer
  • Explain why you will do these particular things when driving.
    11·1 answer
  • __________ makes the hardware usable, while __________ commands it to perform specific tasks. a.) The operating system, RAM b.)
    10·2 answers
  • Create a new Java class called AverageWeight. Create two arrays: an array to hold 3 different names and an array to hold their w
    13·1 answer
  • Which of the following pieces of evidence was NOT used to support the Theory of Continental Drift?
    10·1 answer
  • Which of the following shows how to correctly declare pointer variable x?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!