Question

1. In a function that gets a value from the keyboard and communicates that value to...

1. In a function that gets a value from the keyboard and communicates that value to the main
function via a parameter, the parameter used is considered __________.

2. In a function that receives a value from the main function via a parameter and then
displays the parameter value on the screen, that parameter is considered __________.

3. In a function that receives one parameter value from the main program and passes back a
changed value of the parameter, that parameter is considered __________.

4. When the body of a function is implemented temporarily with just a printf call that
displays a message reporting that the function was entered, the programmer is using
__________.

5. What is displayed by this program?
#include <stdio.h>
void seven(int *xp);

int
main(void)
{
int x, y;
x = 5; y = 6;
seven(&x);
seven(&y);
printf("%4d%4d\n", x, y);
return(0);
}
void
seven(int *xp)
{
int y;

y = *xp + 2;
*xp = y * 3;
}

6. When a programmer writes a driver and individually tests a single function before inserting
the function in a program system, the programmer is performing __________.

7. The "*" symbol means:

8. What can be determined by the following declaration?
FILE*inputData;

9. Accessing the contents of memory using a pointer variable that contains the address of that
memory location is called _________.

10. Use ________ testing to verify the correctness of a single function in a program.

11. Declare a pointer variable called "ptr" that can point to a memory address of type integer.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answers:

1. Actual Parameters

2. Formal Parameters

3. Pass by value

4. Pass by reference

5. 21 24

6. Unit testing

7. * makes the variable a pointer

8. a. We use a structure pointer of file type to declare a file

b. *inputData is the FILE pointer (FILE *inputData), which will hold the reference to the opened (or created) file

9. Dereference operator

10. Unit testing

11. int x=10;
int *ptr;
ptr = &x;
  

Add a comment
Know the answer?
Add Answer to:
1. In a function that gets a value from the keyboard and communicates that value to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program to reverse an integer number by using a function called reverse. The program...

    Write a program to reverse an integer number by using a function called reverse. The program reads in an integer number and prints its reverse order. Note that the function receives the number via a pointer, and uses the pointer to write the reverse number on the main function. The function MUST be used AS IS: void reverse(int *n) Language in C Bonus Problem: Number Reverser reverse c Write a program to reverse an integer number by using a function...

  • 7 Question 27 4 pts What is displayed by this program? #include <stdio.h> void seven(int *xPtr);...

    7 Question 27 4 pts What is displayed by this program? #include <stdio.h> void seven(int *xPtr); int main(void) int x,y: X-5: y = 6: seven(&x): seven(&y): printf("%4d%4d\n", x,y); return(0); void seven(int "xPtr) inty: y -'xPtr+2; *xPtry3; (Show blank spaces with asterisks)

  • Homework Part 1 Write a C program that declares and initializes a double, an int, and a char. You...

    Homework Part 1 Write a C program that declares and initializes a double, an int, and a char. You can initialize the variables to any legal value of your choosing. Next, declare and initialize a pointer variable to each of the variables Using printf), output the following: The address of each of the first three variables. Use the "Ox%x" format specifier to print the addresses in hexadecimal notation The value of each variable. They should equal the value you gave...

  • Please in C Language Thank you! The following program source code is incomplete 1 #include <stdio.h> 2 3 // TODO:...

    Please in C Language Thank you! The following program source code is incomplete 1 #include <stdio.h> 2 3 // TODO: 1) Add the typedef here: 5// TODO: 2) Modify the parameter of repeat to add irn the function pointer for the function to be called repeatedly: 8 void repeat (int times) for (int k 0; k < times; ++k) 12 // TODO: 3) Add the call to the function pointer here: 14 15 17 void test (void) 18 printf("Test!\n"); 19...

  • Purpose The purpose of the lab is to learn how to pass pointers in C. Process Create the function...

    Programming in C Purpose The purpose of the lab is to learn how to pass pointers in C. Process Create the functions as defined in the following table. Each function will add the last two integer parameters together Function PrototypeReturr int add2a(int,int); Returns the sum as a return value void add2b(int* int,int); Returns the sum in the first parameter int add2c(int*,int,int); Returns the sum as a return value and in the first parameter Returns the sum as a pointer to...

  • We want to write a function called sortTwo that takes two integer parameters, and after the...

    We want to write a function called sortTwo that takes two integer parameters, and after the function is called the first parameter is the smaller of the two values, and the second parameter is the larger of the two values. In other words, this is a miniature sorting function. For this problem you must supply the missing code for PARTs 1, 2, and 3 in the program below. // PART 1: function prototype int main ( ) { int x,y;...

  • please use c ++ language and write the comment too. thanks Pointer Arithmetic Write a function...

    please use c ++ language and write the comment too. thanks Pointer Arithmetic Write a function that passes an array address to a function as a pointer. Using pointer arithmetic, the function determines the average, high, and low value of the array. Your function should have this header: void pointerArithmetic(int *array, int size, double &average, int &high, int &low) Parameter size is the number of elements in array. You may not use the subscript notation [] inside your function –...

  • C++ 1. The copy constructor is used for one the following scenarios: I. Initialize one object...

    C++ 1. The copy constructor is used for one the following scenarios: I. Initialize one object from another of the same type. II. Copy an object to pass it as argument to a function. III. Copy an object to return it from a function. Read the following program and answer questions (20 points) #include <iostream> using namespace std; class Line public: int getLength( void); Line( int len // simple constructor Line( const Line &obj) 1/ copy constructor Line (); //...

  • C ++ 1. Write down the missing code according to the comments. #include <cstdlib> #include <iostream>...

    C ++ 1. Write down the missing code according to the comments. #include <cstdlib> #include <iostream> using namespace std; void fun1(int radius) {     /*     dynamic memory management     */     double * dmptr;     double circumference;         /*     add the code below to:     - allocate a memory location for a double and nameless variable in heap and assign its address to the pointer     - assign 3.14 to the variable in heap via the pointer....

  • Homework Question Write a void function called transformArray that takes two parameters - a reference to...

    Homework Question Write a void function called transformArray that takes two parameters - a reference to a pointer to a dynamically allocated array of ints, and the size of that array.  The pointer is passed by referencebecause you want to change the value of the pointer. The function should dynamically allocate an array that is twice as long, filled with the values from the original array followed by each of those values times 2. For example, if the array that was...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT