Showing posts with label Type. Show all posts
Showing posts with label Type. Show all posts

Sunday, March 12, 2017

C++ Part 20

An enumeration type is a type whose values are defined by a list of constants of typeint. An enumeration type is very much like a list of declared constants. 

enum MonthLength { JAN_LENGTH = 31, FEB_LENGTH = 28,
MAR_LENGTH = 31, APR_LENGTH = 30, MAY_LENGTH = 31,
JUN_LENGTH = 30, JUL_LENGTH = 31, AUG_LENGTH = 31,
SEP_LENGTH = 30, OCT_LENGTH = 31, NOV_LENGTH = 30,
DEC_LENGTH = 31 };  


enum Direction { NORTH = 0, SOUTH = 1, EAST = 2, WEST = 3 };
is equivalent to
enum Direction { NORTH, SOUTH, EAST, WEST };  


Intro to C++ Part 12

  • How Do I Start a Program? 


  1.  Identify inputs and outputs.
  2. Understand what you asked for ( Ask Questions ).
  3. Break the program down. // Functions
  4. into steps, writing each step in pseudocode English.
  5.  Replace each pseudocode step with C++ codes.

Saturday, March 11, 2017

Intro to C++ Part 5


  • Storage class: How/where in memory is the variable stored? 
  • Type: What is the set of values for the variable?
  • Name: What is the name of the variable? 
  • Scope: Where in the program is the variable visible? 
  • Value: Which value is currently stored in the variable?

Digital Design Part 3

4th→ assembler translates it to the machine language. 1.6 [20] <§1.6> Consider two different implementations of the same instru...