EBK STARTING OUT WITH VISUAL C#
EBK STARTING OUT WITH VISUAL C#
5th Edition
ISBN: 9780135204818
Author: GADDIS
Publisher: VST
Expert Solution & Answer
Book Icon
Chapter 9, Problem 6SA

Explanation of Solution

Enumerated data type:

Yes”, enumerators can be used in a loop to step through the elements in an array as they are used to represent the integer values.

  • This is a programmer defined data type and the elements contained in it are also defined by the programmer or user.
  • The elements are known as enumerators and represent the integer values.
  • Declaration of enumerator has three parts as follows:
    • enum keyword
    • Enumerator name
    • List of identifiers
  • When the identifiers are enclosed in braces, they are called enumerators and if they are enclosed in quotation marks, they are known as strings.
  • Declaration:

enum Names{aa, bb, cc};

Program snippet to show the above statement:

//declare the arrays

enum day{ Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};

int[] score={10, 20, 30, 40, 50, 60, 70};

//create a text file

StreamWriter outputfile= File...

Blurred answer

Chapter 9 Solutions

EBK STARTING OUT WITH VISUAL C#

Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education