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.

Chapter 11

Quiz yourself by thinking what should be in each of the black spaces below before clicking on it to display the answer.
        Help!  

Question
Answer
What is a primitive data type?   A data type that is defined as a basic part of the language. Ex. bool, char, int, short int, long int, double, float, etc.  
🗑
What is an abstract data type?   a data type created by the programmer and is composed of one or more primitive data types  
🗑
an example of a structure declaration.   struct PayRoll { int empNumber; string name; double hours, payRate, grossPayl };  
🗑
is it possible to definre multiple structure variables in a program?   yes.  
🗑
assume that PayRoll is a Structure Declaration, how would you define three variables to it? The three variables are deptHead, foreman, and associate.   PayRoll deptHead, foreman, associate;  
🗑
what operator allows you to access structure members in a program?   the dot operator (.)  
🗑
what does this statement do? deptHead.empNumber = 475;   the number 475 is assigned to the empNumber member of the deptHead. The dot operator connects the name of the member variable with the name of the stricture variable it belongs to.  
🗑
how could you initialize this structure? struct CityInfo { string cityName; string state; long population; int distance; };   use an initialization list. CityInfo location = {"Asheville", "NC", 50000, 28};  
🗑
Do you have to initialize all members of the structure variable? struct CityInfo { string cityName; string state; long population; int distance; };   No. for example, CityInfo location = {"Tampa"};  
🗑
Define the example as an array. struct BookInfo { string title; string author; string publisher; double price; };   BookInfo bookList[20];  
🗑
You can access a member of any element in an array of a structure variable. How would you write this?   bookList[5].title  
🗑
How would you initialize a structure array?   PayInfo workers[NUM_WORKERS] = { {10, 9.75}; {15, 8.62}; {20, 10.50}; };  
🗑
True or false, It is possible for a structure variable to a member of another strucutre variable.   true  
🗑
True or False. Strucutre variables cannot be passed as arguments to functions   false  
🗑
Why should large structures be passed by reference?   Because passing by value will decrease the speed and overall performance of your code.  
🗑
what is a disadvantage of passing a structure by reference?   the function that the structure has been passed into has access to the original argument. This means that the data of the structure could potentially be altered.  
🗑
how would you define a variable that is a pointer to a structure?   data type followed by an asterisk and then the name of the pointer variable. Ex. Circle *cirPtr;  
🗑
When would you use the pointer operator (->)   it is used to dereference a pointer to a structure, not a pointer that is a member f a structure.  
🗑
What is a union?   similar to a structure except all the members occupy the same memory area  
🗑
What is an anonymous union?   it is a union without a name. however, members of the union have names.  
🗑


   

Review the information in the table. When you are ready to quiz yourself you can hide individual columns or the entire table. Then you can click on the empty cells to reveal the answer. Try to recall what will be displayed before clicking the empty cell.
 
To hide a column, click on the column name.
 
To hide the entire table, click on the "Hide All" button.
 
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
 
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.

 
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
Created by: kcpaxton
Popular Computers sets