Starting out with Visual C# (4th Edition)
Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 9, Problem 1MC

Each object that is created from a class is called a(n)_______ of the class.

  1. a. reference
  2. b. example
  3. c. instance
  4. d. event
Expert Solution & Answer
Check Mark
Program Description Answer

An instance of a class refers to each object created from a class.

Hence, the correct answer is option “C”.

Explanation of Solution

Instance of a class:

  • • A class is defined as a group of user defined data structure that consists of fields, properties, and methods that can perform several operations for all instances of the class.
  • • A class acts as a declaration of a real world entity.
  • • An object of a class cannot be directly created until it has its own properties and methods.
  • • When an instance of a class is created, a separate memory block is being created in the memory.
  • • A class is a blue-print which describes how an instance of the class is created.

Explanation for incorrect options:

Reference:

To pass the instance of a class to a method parameter, a reference is used.

Hence, the option “A” is wrong.

Example:

Example contains the real time information regarding an event.

Hence, the option “B” is wrong.

Event:

An event is defined as a specific task performed to attain a target output.

Hence, the option “D” is wrong.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
01:22
Students have asked these similar questions
Create a class called Date that includes three instance variables-a month (type int), a day (type int) and a year (type int). Provide a constructor that initializes the three instance variables and assumes that the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day and year separated by forward slashes (/). Add a main method to the class that demonstrates class Date's capabilities.
Write Rectangle class to represent a rectangle. The class contains:a. Two double data fields named width and height that specify the width and height ofthe rectangle. The default values are 1 for both width and height.b. A no-arg constructor that creates a default rectangle.c. A constructor that creates a rectangle with the specified width and height.d. A method named getArea() that returns the area of this rectangle.e. A method named getPerimeter() that returns the perimeter.
Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variable   Part number(type String)   Part description(type String)   Quantity of the item being purchased (type int)   Price per item (double). Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. In addition, provide a method named getInvoice Amount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0.0. Write a test application named InvoiceTest that demonstrates class Invoice’s capabilities.

Chapter 9 Solutions

Starting out with Visual C# (4th Edition)

Ch. 9.3 - What is a parameterized constructor?Ch. 9.3 - Prob. 9.12CPCh. 9.3 - Prob. 9.13CPCh. 9.3 - What happens if you write a class with no...Ch. 9.3 - Describe the purpose of the default constructor.Ch. 9.4 - Prob. 9.16CPCh. 9.4 - How can you initialize an array of a class type...Ch. 9.4 - Prob. 9.18CPCh. 9.5 - Prob. 9.19CPCh. 9.5 - When designing an object-oriented application, who...Ch. 9.5 - How do you identify the potential classes in a...Ch. 9.5 - What are a classs responsibilities?Ch. 9.5 - What two questions should you ask to determine a...Ch. 9.5 - Will all a class's actions always be directly...Ch. 9.6 - Prob. 9.25CPCh. 9.6 - Prob. 9.26CPCh. 9.6 - Prob. 9.27CPCh. 9.6 - Prob. 9.28CPCh. 9.6 - Prob. 9.29CPCh. 9 - Each object that is created from a class is called...Ch. 9 - Prob. 2MCCh. 9 - The first line of a class declaration is known as...Ch. 9 - The classs________ are the statements that define...Ch. 9 - A(n) _____ is a method that is automatically...Ch. 9 - A(n) is a special type of class member that allows...Ch. 9 - A special set of methods, known as_________, work...Ch. 9 - Prob. 8MCCh. 9 - The parameter of the set accessor is automatically...Ch. 9 - A can be read, but it cannot be modified. a....Ch. 9 - When the value of an item is dependent on other...Ch. 9 - A constructor that accepts arguments is known as...Ch. 9 - Prob. 13MCCh. 9 - Prob. 14MCCh. 9 - A methods ______ consists of the methods name and...Ch. 9 - A is a constructor that accepts no arguments. a....Ch. 9 - If you write a class with no constructor...Ch. 9 - Prob. 18MCCh. 9 - A classs responsibilities are_______. a. the...Ch. 9 - Prob. 20MCCh. 9 - Objects that are instances of a class are always...Ch. 9 - Prob. 2TFCh. 9 - A class is an object.Ch. 9 - It is a common practice to make all a classs...Ch. 9 - The same rules for naming variables apply to...Ch. 9 - If you need to make a property read only, you...Ch. 9 - If you try to pass a property to a ref or an out...Ch. 9 - Class fields are almost always declared public in...Ch. 9 - The get accessor can be thought of as a method...Ch. 9 - Constructors can accept arguments in the same way...Ch. 9 - It is legal to write a class without any...Ch. 9 - Objects that are instances of a class can be...Ch. 9 - Prob. 13TFCh. 9 - One way to find the classes needed for an...Ch. 9 - Prob. 15TFCh. 9 - By default, a controls Modifiers property is set...Ch. 9 - Prob. 1SACh. 9 - What are the advantages of storing classes in...Ch. 9 - How is a constructor used?Ch. 9 - What is the difference between a class and an...Ch. 9 - What convention do most programmers follow when...Ch. 9 - What is the value parameter? How is it created?Ch. 9 - What is executed any time a class property is...Ch. 9 - What is executed any rime a value is assigned to a...Ch. 9 - How can you protect class fields from accidental...Ch. 9 - Prob. 10SACh. 9 - Is it possible to pass initialization values to...Ch. 9 - How does the compiler distinguish a method from...Ch. 9 - What do you call the constructor that is provided...Ch. 9 - Prob. 14SACh. 9 - Prob. 15SACh. 9 - Prob. 16SACh. 9 - Prob. 17SACh. 9 - Write a statement that creates an instance of the...Ch. 9 - Write the accessors for a property named...Ch. 9 - Prob. 3AWCh. 9 - Look at the following description of a problem...Ch. 9 - Pet Class Create a class named Pet (similar to the...Ch. 9 - Car Class Create a class named Car that has the...Ch. 9 - Personal Information Class Create a class that...Ch. 9 - Employee Class Write a class named Employee that...Ch. 9 - RetailItem Class Write a class named RetailItem...Ch. 9 - Dorm and Meal Plan Calculator A university has the...Ch. 9 - E-Mail Address Book Create an application with a...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Why were computer programming languages invented?

Starting Out with C++ from Control Structures to Objects (9th Edition)

(Asterisked problems are associated with optional sections.) 21. Suppose you were given three stacks and you we...

Computer Science: An Overview (13th Edition) (What's New in Computer Science)

Write a statement that opens the file Customers.dat as a random access file for both reading and writing.

Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)

What is denormalization?

Database Concepts (8th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY