Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

C++ ch9 extra

QuestionAnswer
What two reasons do programmers use functions for? (1) so there is less duplication of code(2) to allow large and complex programs to be broken into small and manageable tasks.
The main function returns its one value to the ___. oeprating system.
The ___ function returns a string of characters entered by the user at the keyboard. getline()
The ___ function returns the uppercase equivalent of a string. toupper()
What is the syntax of the pow function? Explain. pow(x, y)x is the number you want raised to power y.
To use the pow function ins a program, the program must contain the __ directive? #include <cmath>
cube = pow(4.0, 3) Explain The double 4.0 is raised to the third power(4.0 * 4.0 * 4.0) and the answer is assigned to the cube variable.
What is the syntax to specifiy the range of a random number? Write the formula for a range of 1 -6 lowerbound + rand() % (upperbound - lowerbound + 1)1 + rand() % (6 - 1 + 1);
Show and explain the syntax of the srand function. srand(seed)seed is an integer that represents the starting point for the random number generator.
Most C++ programmers use the built-in __ function as the -seed-. time()
A program uses the statement discount = calcDisc(300.45); to call the calcDisc functions, which returns a number having a decimal place. Which is a valid function header for the calcDisc function? double calcDisc(double sales)
Most C++ programmers enter the function definition where? below the main function in a program.
A function prototype can be thought of as the ? table of contents in a book. (simply a preview of what will be expanded on later)
What is the syntax of a function prototype? Give an example. returnDataType functionName(parameterList);int calcRectangleArea(int, int);
What is the difference between a function header and a function prototype? (1) A function prototype ends with a semicolon.(2)The function header contains both the data type and name of each formal paramter, but the function prototype contains only the data type.
The function prototype is necessary only when ? the function is defined after the main() function.
The formal parameters are defined in the ? function definitions
Created by: kat1350
Popular Computers sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards