KRHS Internet Lesson

Teacher Name:Mr. Rung                          Date of Lesson: January

Course Name: C++                    Lesson Name: Chap 10.4a

Student Name

Password


Objective
To complete the workbook problems.


Primary Focus
Answer the questions in the spaces provided below.

Site Links
Course Home Page

Additional Resources

Site Links


Question #1

Structures allow variables to be grouped to form a new data type.

True         False


Question #2

The variables in a structure must be of the same type.

True         False


Question #3

A structure cannot be part of another structure.

True         False


Question #4

A structure can include an enumerated data type.

True         False


Question #5

A structure is a good way to represent the x and y coordinates that define a point on a line.

True         False


Section 2 Question #1

Write your answer in the space following the questions
Define the term record as it relates to database programs.


Section 2 Question #2

Define the term field as it relates to database programs.


Section 2 Question #3

After you have declared a structure, why must you declare a variable that is of the structure's type?


Section 2 Question #4

Write a declaration for a structure named student that is to be used to store records in a college database system. The fields in the record should include name, address, phone number, classification, age, hours completed, and hours needed to graduate.


Section 2 Question #5

Analyze the code below and answer the questions which follow

  struct point 
  { 
  double x; 
  double y; 
  } 
  struct line 
  { 
  point pl; 
  point p2; 
  } 

  a. Write a statement that declares a line named my-line. 

  b. Write statements that set the x and y coordinates of the points that make up the line
  to (2,3) and (4,6). 

  c. Write a statement that sets the x coordinate of the second point to the value of the y
  coordinate of the first point.