Question

1. A global variable is a variable that’s defined Group of answer choices within any block...

1. A global variable is a variable that’s defined

Group of answer choices

within any block of code

within any function

outside of any function

within a header file

2.

Which of the following is/are differences between value variables and reference variables?

Group of answer choices

A value variable stores a copy of a value in memory, and a reference variable refers to a value that already exists in memory.

Changing the value of a value variable doesn’t change the value of any other variables, but changing the value of a reference variable also changes the values of any other variables that refer to that value.

A value variable can be used as a parameter for a function but a reference variable can’t.

All of the above

a and b only

3.

Which of the following should you code in the implementation file for a header file?

Group of answer choices

using directives or declarations

function declarations

variables definitions

all of the above

a and c only

4.

The purpose of a function prototype is to

Group of answer choices

declare a function

provide the code for a function

define the default values for the arguments that are passed to a function

provide for overloading a function

5.

Which of these function declarations is not a valid overload for the following function declaration?
double calculate_mpg(double miles, double gallons);

Group of answer choices

double calculate_mpg(double miles, double gallons, int decimal_places);

double calculate_mpg(int miles, int gallons);

double calculate_mpg(int miles, int gallons, int decimal_places);

int calculate_mpg(double miles, double gallons);

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

1)  outside of any function
2)  a and b only
3)  a and c only    (not 100% sure about this one)
4)  declare a function
5)  int calculate_mpg(double miles, double gallons);
Add a comment
Know the answer?
Add Answer to:
1. A global variable is a variable that’s defined Group of answer choices within any block...
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
  • answer in c++ Using the table below, complete the C++ code to write the function prototype...

    answer in c++ Using the table below, complete the C++ code to write the function prototype statement, and the void function header. The void function should receive three double variables: the first two by value and the last one by reference. Name the formal parameters num1, num2 and answer. The function should divide the num1 variable by the num2 variable and then store the result in the answer variable. Name the function calcQuotient. Also write an appropriate function prototype for...

  • Question 1 Answer the questions below about this function prototype: double coinTotal (double coinValue, int nCoins);...

    Question 1 Answer the questions below about this function prototype: double coinTotal (double coinValue, int nCoins); What is the type of the return value?   How many parameters does the function take? What is the name of the function? Question 2 These are defined in the function heading and tell a user what data needs to be sent to a function. Question 3 What is the term used for a variable sent as data in a function call, such as n1...

  • Compute for Miles Per Gallon in C++

    Make a program that will calculate and compute for the quotient of miles and gallons (mpg: miles per gallons). Your program should must ask the user to specify the size of the array (using dynamic array) for the following variable: miles ,gallons and mpg. Prompt the user to Initialize  the value of miles (value for miles should be 100-250) and gallons (values should be from 5-25). Use pointer galPtr for gallons, milPtr for miles and mpgPtr for mpg.  Use function...

  • Question 11 pts Fill in the blank. Two functions are defined main.c and MyAge.c   // FILE...

    Question 11 pts Fill in the blank. Two functions are defined main.c and MyAge.c   // FILE main.c main ( ) { _______ int age ; printf ( " the value of age is %d \n", age ) ; } // FILE MyAge.c int age = 10; int MyAge ( ) { } Group of answer choices static external internal extern Flag this Question Question 21 pts Fill in the blank. Two functions are defined main.c and MyAge.c   The below program...

  • //Add name, date, and description here //preprocessor directives #de fine CRT SECURE NO WARNINGS ...

    Complete the incomplete code provided //Add name, date, and description here //preprocessor directives #de fine CRT SECURE NO WARNINGS #includestdio.h> - //Calculate the cost of the gas on a trip /Ideclare, ask, and get the price per gallon and the mpg /Icalculate and return (by reference) the cost of gas for the number of miles passed to the function void GasCost (double miles, double *gasTotalPtr) //using a 70 MPH speed limit and the miles passed to the function //calculate and...

  • Write a code in C++ by considering the following conditions :- Tasks :- 1. Create a...

    Write a code in C++ by considering the following conditions :- Tasks :- 1. Create a class Employee (with member variables: char * name, int id, and double age). 2. Create a constructor that should be able to take arguments and initialize the member variables. 3. Create a copy constructor for employee class to ensure deep copy. 4. Create a destructor and de allocate the dynamic memory. 5. Overload the assignment operator to prevent shallow copy and ensure deep copy....

  • Must Follow Example code //Add name, date, and description here //preprocessor directives #de fine CRT SECURE...

    Must Follow Example code //Add name, date, and description here //preprocessor directives #de fine CRT SECURE NO WARNINGS #includestdio.h> - //Calculate the cost of the gas on a trip /Ideclare, ask, and get the price per gallon and the mpg /Icalculate and return (by reference) the cost of gas for the number of miles passed to the function void GasCost (double miles, double *gasTotalPtr) //using a 70 MPH speed limit and the miles passed to the function //calculate and return...

  • Eclipse Java Oxygen Question 11 pts A compile-time error occurs when Group of answer choices c....

    Eclipse Java Oxygen Question 11 pts A compile-time error occurs when Group of answer choices c. there’s a syntax error in a Java statement a. the Java compiler can’t be located b. bytecodes can’t be interpreted properly c. there’s a syntax error in a Java statement Flag this Question Question 21 pts An error that lets the application run but produces the wrong results is known as a Group of answer choices d. syntax error c. logic error a. runtime...

  • Need help on C++ (User-Defined Function) Format all numerical decimal values with 4 digits after ...

    need help on C++ (User-Defined Function) Format all numerical decimal values with 4 digits after the decimal point. Process and sample run: a) Function 1: A void function that uses parameters passed by reference representing the name of a data file to read data from, amount of principal in an investment portfolio, interest rate (any number such as 5.5 for 5.5% interest rate, etc.) , number of times the interest is compounded, and the number of years the money is...

  • 1. What does the below C++ statement do? vector<double> myVec(20); Group of answer choices A.It creates...

    1. What does the below C++ statement do? vector<double> myVec(20); Group of answer choices A.It creates a vector object that can only store values of 10 or less. B.It creates a vector object with a starting size of 10. C.It creates a vector object and initializes the first element with the value 20. D.It creates a vector object with a starting size of 20. 2. A recursive function contains a call to itself, but is limited to 10 recursive calls...

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