Question

(T or F) The reserved word throw is used to signal that an exception has occurred....

  1. (T or F) The reserved word throw is used to signal that an exception has occurred.
  2. (T or F) The correct use of throw can be anywhere in a program; a try / catch structure is used only in class definitions.
  3. (T or F) In C++, class is not a reserved word.
  4. (T or F) Class attributes have no fixed type; their type can be changed during the program execution.
  5. (T or F) A member of a class can be a method or an attribute.
  6. (T or F)The private attributes of a class cannot be accessed by the public methods of that class.
  7. (T or F) The initialization of a variable in the declaration

Ex: int counter = 0;

is not allowed inside a class definition.

  1. (T or F) In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition.
  2. (T or F) A member of a class that was created “on the stack” (locally) can be accessed by using the dot operator (.) followed by the member name.
  3. (T or F) Class objects can be passed to methods as arguments and can be returned from methods.
  4. (T or F) A class constructor is a method that automatically is called whenever an object is created from the class.
  5. (T or F) a class destructor is another name for a no-arg constructor..
  6. (T or F) a class cannot have more than one constructo
  7. (T or F) a class can have a destructor to match each constructor.
  8. (T or F) The primary purpose of the separation of a class interface from the class implementation enables the code to be more easily read by a human programmer.
  9. (T or F) Every time any method is called, a new “frame” is created in RAM.
    1. (T or F) A “pure” class definition can contain only methods.
    1. (T or F) A class definition by itself, takes very little space in RAM. PLEASE ANSWER ALLLLLL!!!!!!!!!!!!!!!!!!!!!!!!!!!

Homework Answers

Answer #1

1 - The reserved word throw is used to signal that an exception has occurred. - TRUE

2 - The correct use of throw can be anywhere in a program; a try / catch structure is used only in class definitions. - FALSE

3 - In C++, class is not a reserved word. - FALSE

4 - Class attributes have no fixed type; their type can be changed during the program execution. - TRUE

5 - A member of a class can be a method or an attribute. - TRUE

6 - The private attributes of a class cannot be accessed by the public methods of that class. - FALSE

7 - The initialization of a variable in the declaration, Ex: int counter = 0; is not allowed inside a class definition. - FALSE

8 - In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition - TRUE

9 - A member of a class that was created “on the stack” (locally) can be accessed by using the dot operator (.) followed by the member name. - TRUE

10 - Class objects can be passed to methods as arguments and can be returned from methods. - TRUE

11 - A class constructor is a method that automatically is called whenever an object is created from the class.- TRUE

12 - a class destructor is another name for a no-arg constructor..- FALSE

13 - a class cannot have more than one constructor - FALSE

14 - a class can have a destructor to match each constructor. - TRUE

15 - The primary purpose of the separation of a class interface from the class implementation enables the code to be more easily read by a human programmer. - TRUE

16 - Every time any method is called, a new “frame” is created in RAM. - TRUE

17 - A “pure” class definition can contain only methods. - FALSE

18 - A class definition by itself, takes very little space in RAM - FALSE

Know the answer?
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
Similar Questions
QUESTION 1: This question is also to be used for the next question. Design an Employee...
QUESTION 1: This question is also to be used for the next question. Design an Employee class for a hotel for use in programs. We need an Employee object with these attributes: Name Designation (ex. Manager, Supervisor, Waiter, Bellhop, etc.) ID number Some details: ID Numbers should already be known at time of object's creation. Assume it is an 8 digit number. The ID Number can never be changed Use strings to represent the Name and Designation It is possible...
A stack can be used to print numbers in other bases (multi-base output). Examples: (Base8) 2810...
A stack can be used to print numbers in other bases (multi-base output). Examples: (Base8) 2810 = 3 * 81 + 4 * 80 = 348 (Base4) 7210 = 1 * 43 + 0 * 42 + 2 * 41 + 0 * 4 = 10204 (Base 2) 5310 = 1 * 25 + 1*24 + 0 * 23 + 1 * 22 + 0 * 21 + 1 * 20 = 1101012 Write a java program using stacks that...
Create a simple Java class for a Month object with the following requirements:  This program...
Create a simple Java class for a Month object with the following requirements:  This program will have a header block comment with your name, the course and section, as well as a brief description of what the class does.  All methods will have comments concerning their purpose, their inputs, and their outputs  One integer property: monthNumber (protected to only allow values 1-12). This is a numeric representation of the month (e.g. 1 represents January, 2 represents February,...
C# Step 1: Create a Windows Forms Application. Step 2: Create a BankAccount class. Include: Private...
C# Step 1: Create a Windows Forms Application. Step 2: Create a BankAccount class. Include: Private data fields to store the account holder's name and the account balance A constructor with 0 arguments A constructor with 1 argument (account holder's name) A constructor with 2 arguments(account holder's name and account balance) Public properties for the account holder's name and the account balance. Do not use auto-implemented properties. A method to increase the balance (deposit) A method to decrease the balance...
This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program). Extend...
This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program). Extend the ItemToPurchase class per the following specifications              Private fields string itemDescription - Initialized in default constructor to "none" Parameterized constructor to assign item name, item description, item price, and itemquantity (default values of 0).             Public instance member methods setDescription() mutator & getDescription() accessor (2 pts) printItemCost() - Outputs the item name followed by the quantity, price, and subtotal printItemDescription() - Outputs the...
3.2 Class Dictionary This class implements a dictionary using a hash table in which collisions are...
3.2 Class Dictionary This class implements a dictionary using a hash table in which collisions are resolved using separate chaining. The hash table will store objects of the class Data. You will decide on the size of the table, keeping in mind that the size of the table must be a prime number. A table of size between 5000-10000, should work well. You must design your hash function so that it produces few collisions. A bad hash function that induces...
JAVA please Arrays are a very powerful data structure with which you must become very familiar....
JAVA please Arrays are a very powerful data structure with which you must become very familiar. Arrays hold more than one object. The objects must be of the same type. If the array is an integer array then all the objects in the array must be integers. The object in the array is associated with an integer index which can be used to locate the object. The first object of the array has index 0. There are many problems where...
Code in Java SAMPLE PROGRAM OUTPUT Because there are several different things your program might do...
Code in Java SAMPLE PROGRAM OUTPUT Because there are several different things your program might do depending upon what the user enters, please refer to the examples below to use to test your program. Run your final program one time for each scenario to make sure that you get the expected output. Be sure to format the output of your program so that it follows what is included in the examples. Remember, in all examples bold items are entered by...
Do the TODOs in SongFileAccessor.java. It inherits from FileAccessor class. TODO 1: Implement the processLine method....
Do the TODOs in SongFileAccessor.java. It inherits from FileAccessor class. TODO 1: Implement the processLine method. When the text file is processed, each line of text will be passed to processLine . Each line contains 4 fields: title, album, artist, and play time. The album field is optional. Each field is separated by a comma. TODO 2: Implement the songToCSVString method. This method takes a Song object as a parameter and returns a String which is the csv representation of...
The Galactic Federation of Planets (GFP) maintains records on all planets that are applying to become...
The Galactic Federation of Planets (GFP) maintains records on all planets that are applying to become members of the GFP. A planet may make an application to become a member of the Galactic Federation of Planets when their technology has led them to develop Star Gate technology enabling them to travel to other planets in the galaxy outside their own solar system. Your assignment is to create a class that can be used to hold the basic information about a...