Pre-Lab - Lab (15)



Answer the following questions in writing.

1) Use the following struct definition to write a code segment to store 10 values starting from 100 and ending at 1000 with 100 intervals.  Each one of these numbers has an order, thus 100 is the first, 200 is the second, and so forth.

struct Record
{
        string order;
        int number;
}
 
 
 

2) Suppose we wish to preserve the order but add a new case to the above list.  The new case is:

7th         655
 

Explain how the integer 655 could be inserted into the 7th position?
 
 
 
 
 
 
 
 
 
 

3) Can we write a function that can be used to swap two variables of type char or two objects of type Money.