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
You wrote a program to compare the portion of drivers who were on the phone. Which statements are true? Select 4 options.
Charra [1.4K]

Answer:

1,2,3,5 (it's not the one that starts with your program)

Explanation:

Edge 2020

3 0
3 years ago
Teniendo en cuenta la realidad mundial acerca de la pandemia, ¿cómo crees que impacta
KatRina [158]

Answer:

1.)death 2.)mow the lawn 3.)landscaping telemarketing teach.

FOR SPAINISH

1.) muerte 2.) cortar el césped 3.) paisajismo telemarketing enseñar.

5 0
3 years ago
Web definition what means web
yan [13]
A network of fine threads constructed by a spider from fluid secreted by its spinnerets, used to catch its prey.
7 0
3 years ago
Write a program that asks the user to input four numbers (one at a time). After the four numbers have been supplied, it should t
nika2105 [10]

Answer:

<u>Output</u>

Enter first number:  

1

Enter second number:  

2

Enter third number:  

3

Enter fourth number:  

4

Average: 2.5

Explanation:

Below is the java program to calculate the average of four numbers:-

import java.util.Scanner;

public class Average {

public static void main(String[] args){

 int a,b,c,d;

 double average=0.0;

 Scanner s=new Scanner(System.in);

 System.out.println("Enter first number: ");

 a=s.nextInt();

 System.out.println("Enter second number: ");

 b=s.nextInt();

 System.out.println("Enter third number: ");

 c=s.nextInt();

 System.out.println("Enter fourth number: ");

 d=s.nextInt();

 average=(a+b+c+d)/4.0;

 System.out.println("Average: "+average);

}

}

6 0
3 years ago
What's the best way to change the font size of all your notes pages at once?
defon
On which os? mac os windows linux?
7 0
3 years ago
Other questions:
  • After trying multiple times, a coworker is not able to fit a motherboard in a computer case, and is having difficulty aligning s
    11·1 answer
  • Although designed to support remote dial-in access to a corporate network, what service below is commonly used with 802.1x port
    12·1 answer
  • A______ is a graphical representation of numeric data.
    8·1 answer
  • Accepting criticism is a trait of what people?
    5·1 answer
  • Select the correct answer.
    6·2 answers
  • What game is this? help mee?
    8·2 answers
  • Each of these is a step in cEach of these is a step in conflict resolution: Evaluate solutions suggested. Define the problem. De
    7·1 answer
  • Write bash script which takes array as an input of size 10 bind its even indexes to accept even values and odd indexes to accept
    5·1 answer
  • You must configure a certificate authority on your network to use EFS. True or False?
    5·1 answer
  • A word or phrase to help identify a file when you do not know the file name during the file expiration search
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!