SlideShare a Scribd company logo
Visit https://testbankdeal.com to download the full version and
explore more testbank or solutions manual
Starting Out with C++ from Control Structures to
Objects 8th Edition Gaddis Solutions Manual
_____ Click the link below to download _____
https://testbankdeal.com/product/starting-out-with-c-from-
control-structures-to-objects-8th-edition-gaddis-solutions-
manual/
Explore and download more testbank or solutions manual at testbankdeal.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Starting Out with C++ from Control Structures to Objects
8th Edition Gaddis Test Bank
https://testbankdeal.com/product/starting-out-with-c-from-control-
structures-to-objects-8th-edition-gaddis-test-bank/
Starting Out With C++ From Control Structures To Objects
9th Edition Gaddis Solutions Manual
https://testbankdeal.com/product/starting-out-with-c-from-control-
structures-to-objects-9th-edition-gaddis-solutions-manual/
Starting Out With C++ From Control Structures To Objects
7th Edition Gaddis Solutions Manual
https://testbankdeal.com/product/starting-out-with-c-from-control-
structures-to-objects-7th-edition-gaddis-solutions-manual/
Computing Essentials 2019 27th Edition OLeary Test Bank
https://testbankdeal.com/product/computing-essentials-2019-27th-
edition-oleary-test-bank/
Managerial Economics 3rd Edition Froeb Solutions Manual
https://testbankdeal.com/product/managerial-economics-3rd-edition-
froeb-solutions-manual/
Marketing 4th Edition Grewal Test Bank
https://testbankdeal.com/product/marketing-4th-edition-grewal-test-
bank/
Engineering Economy 15th Edition Sullivan Test Bank
https://testbankdeal.com/product/engineering-economy-15th-edition-
sullivan-test-bank/
Your College Experience Concise 12th Edition Gardner
Solutions Manual
https://testbankdeal.com/product/your-college-experience-concise-12th-
edition-gardner-solutions-manual/
Estimating Construction Costs 6th Edition Peurifoy
Solutions Manual
https://testbankdeal.com/product/estimating-construction-costs-6th-
edition-peurifoy-solutions-manual/
Microeconomics 5th Edition Besanko Test Bank
https://testbankdeal.com/product/microeconomics-5th-edition-besanko-
test-bank/
PURPOSE 1. To introduce and allow students to work with arrays
2. To introduce the typedef statement
3. To work with and manipulate multidimensional arrays
PROCEDURE 1. Students should read the Pre-lab Reading Assignment before coming to lab.
2. Students should complete the Pre-lab Writing Assignment before coming to lab.
3. In the lab, students should complete labs assigned to them by the instructor.
L E S S O N S E T
7 Arrays
Contents Pre-requisites
Approximate
completion
time
Page
number
Check
when
done
Pre-lab Reading Assignment 20 min. 114
Pre-lab Writing Assignment Pre-lab reading 10 min. 122
LESSON 7A
Lab 7.1
Working with One- Basic understanding of 30 min. 123
Dimensional Arrays one-dimensional arrays
Lab 7.2
Strings as Arrays of Basic understanding of 20 min. 126
Characters arrays of characters
LESSON 7B
Lab 7.3
Working with Two- Understanding of multi- 30 min. 129
Dimensional Arrays dimensional arrays
Lab 7.4
Student Generated Code Basic understanding 30 min. 134
Assignments of arrays
113
114 LESSON SET 7 Arrays
PRE-LAB READING ASSIGNMENT
One-Dimensional Arrays
So far we have talked about a variable as a single location in the computer’s
memory. It is possible to have a collection of memory locations, all of which
have the same data type, grouped together under one name. Such a collection
is called an array. Like every variable, an array must be defined so that the com-
puter can “reserve” the appropriate amount of memory. This amount is based upon
the type of data to be stored and the number of locations, i.e., size of the array,
each of which is given in the definition.
Example: Given a list of ages (from a file or input from the keyboard), find
and display the number of people for each age.
The programmer does not know the ages to be read but needs a space for the
total number of occurrences of each “legitimate age.” Assuming that ages 1,
2, . . . , 100 are possible, the following array definition can be used.
const int TOTALYEARS = 100;
int main()
{
int ageFrequency[TOTALYEARS]; //reserves memory for 100 ints
:
return 0;
}
Following the rules of variable definition, the data type (integer in this case) is
given first, followed by the name of the array (ageFrequency), and then the total
number of memory locations enclosed in brackets. The number of memory loca-
tions must be an integer expression greater than zero and can be given either as
a named constant (as shown in the above example) or as a literal constant (an
actual number such as 100).
Each element of an array, consisting of a particular memory location within
the group, is accessed by giving the name of the array and a position with the array
(subscript). In C++ the subscript, sometimes referred to as index, is enclosed in
square brackets. The numbering of the subscripts always begins at 0 and ends with
one less than the total number of locations. Thus the elements in the ageFrequency
array defined above are referenced as ageFrequency[0] through ageFrequency[99].
0 1 2 3 4 5 . . . . . . 97 98 99
If in our example we want ages from 1 to 100, the number of occurrences of
age 4 will be placed in subscript 3 since it is the “fourth” location in the array.
This odd way of numbering is often confusing to new programmers; however, it
quickly becomes routine.1
1
Some students actually add one more location and then ignore location 0, letting 1 be the
first location. In the above example such a process would use the following definition: int
agefrequency[101]; and use only the subscripts 1 through 100. Our examples will use
location 0. Your instructor will tell you which method to use.
Pre-lab Reading Assignment 115
Array Initialization
In our example, ageFrequency[0] keeps a count of how many 1s we read in,
ageFrequency[1] keeps count of how many 2s we read in, etc. Thus, keeping
track of how many people of a particular age exist in the data read in requires
reading each age and then adding one to the location holding the count for that
age. Of course it is important that all the counters start at 0. The following shows
the initialization of all the elements of our sample array to 0.
for (int pos = 0; pos < TOTALYEARS; pos++)
// pos acts as the array subscript
{
ageFrequency[pos] = 0;
}
A simple for loop will process the entire array, adding one to the subscript each
time through the loop. Notice that the subscript (pos) starts with 0. Why is the con-
dition pos < TOTALYEARS used instead of pos <= TOTALYEARS? Remember that
the last subscript is one less than the total number of elements in the array.
Hence the subscripts of this array go from 0 to 99.
Array Processing
Arrays are generally processed inside loops so that the input/output processing
of each element of the array can be performed with minimal statements. Our
age frequency program first needs to read in the ages from a file or from the key-
board. For each age read in, the “appropriate” element of the array (the one cor-
responding to that age) needs to be incremented by one. The following examples
show how this can be accomplished:
from a file using infile as a logical name from a keyboard with –99 as sentinel data
cout << "Please input an age from one"
<< "to 100. input -99 to stop"
<< endl;
infile >> currentAge; cin >> currentAge;
while (infile)
while (currentAge != -99)
{ {
ageFrequency[currentAge-1] = ageFrequency[currentAge-1] =
ageFrequency[currentAge-1] + 1; ageFrequency[currentAge-1] + 1;
infile >> currentAge; cout << "Please input an age from "
<< "one to 100. input -99 to stop"
<< endl;
cin >> currentAge;
} }
The while(infile) statement means that while there is more data in the file
infile, the loop will continue to process.
To read from a file or from the keyboard we prime the read,2
which means
the first value is read in before the test condition is checked to see if the loop
2
Priming the read for a while loop means having an input just before the loop condition
(just before the while) and having another one as the last statement in the loop.
4 0 14 5 0 6 1 0
116 LESSON SET 7 Arrays
should be executed. When we read an age, we increment the location in the
array that keeps track of the amount of people in the corresponding age group.
Since C++ array indices always start with 0, that location will be at the subscript
one value less than the age we read in.
0 1 2 3 4 5 . . . . . . 98 99
1 year 2 years 3 years 4 years 5 years 6 years 99 years 100 years
Each element of the array contains the number of people of a given age. The data
shown here is from a random sample run. In writing the information stored in the
array, we want to make sure that only those array elements that have values
greater than 0 are output. The following code will do this.
for (int ageCounter = 0; ageCounter < TOTALYEARS; ageCounter++)
if (ageFrequency[ageCounter] > 0)
cout << "The number of people " << ageCounter + 1 <<" years old is "
<< ageFrequency[ageCounter] << endl;
The for loop goes from 0 to one less than TOTALYEARS (0 to 99). This will test every
element of the array. If a given element has a value greater than 0, it will be
output. What does outputting ageCounter + 1 do? It gives the age we are deal-
ing with at any given time, while the value of ageFrequency[ageCounter] gives
the number of people in that age group.
The complete age frequency program will be given as one of the lab assign-
ments in Lab 7.4.
Arrays as Arguments
Arrays can be passed as arguments (parameters) to functions. Although variables
can be passed by value or reference, arrays are always passed by pointer, which
is similar to pass by reference, since it is not efficient to make a “copy” of all ele-
ments of the array. Pass by pointer is discussed further in Lesson Set 9. This
means that arrays, like pass by reference parameters, can be altered by the call-
ing function. However, they NEVER have the & symbol between the data type and
name, as pass by reference parameters do. Sample Program 7.1 illustrates how
arrays are passed as arguments to functions.
Sample Program 7.1:
// The grade average program
// This program illustrates how one-dimensional arrays are used and how
// they are passed as arguments to functions. It contains two functions.
// The first function is called to allow the user to input a set of grades and
// store them in an array. The second function is called to find the average
// grade.
#include <iostream>
using namespace std;
Pre-lab Reading Assignment 117
const int TOTALGRADES = 50; // TOTALGRADES is the maximum size of the array
// function prototypes
void getData(int array[], int& sizeOfArray);
// the procedure that will read values into the array
float findAverage(const int array[], int sizeOfArray);
// the procedure that will find the average of values
// stored in an array. The word const in front of the
// data type of the array prevents the function from
// altering the array
int main()
{
int grades[TOTALGRADES]; // defines an array that holds up to 50 ints
int numberOfGrades = 0; // the number of grades read in
float average; // the average of all grades read in
getData(grades, numberOfGrades); // getData is called to read the grades into
// the array and store how many grades there
// are in numberOfGrades
average = findAverage(grades, numberOfGrades);
cout << endl << "The average of the " << numberOfGrades
<< " grades read in is " << average << "." << endl << endl;
return 0;
}
//***********************************************************************
// getData
//
// task: This function inputs and stores data in the grades array.
// data in: none (the parameters contain no information needed by the
// getData function)
// data out: an array containing grades and the number of grades
//***********************************************************************
void getData(int array[], int& sizeOfArray)
{
int pos = 0; // array index which starts at 0
int grade; // holds each individual grade read in
cout << "Please input a grade or type -99 to stop: " << endl;
cin >> grade;
continues
118 LESSON SET 7 Arrays
while (grade != -99)
{
array[pos] = grade; // store grade read in to next array location
pos ++; // increment array index
cout << "Please input a grade or type -99 to stop: " << endl;
cin >> grade;
}
sizeOfArray = pos; // upon exiting the loop, pos holds the
// number of grades read in, which is sent
// back to the calling function
}
//****************************************************************************
// findAverage
//
// task: This function finds and returns the average of the values
//
// data in: the array containing grades and the array size
// data returned: the average of the grades contained in that array
//****************************************************************************
float findAverage (const int array[], int sizeOfArray)
{
int sum = 0; // holds the sum of all grades in the array
for (int pos = 0; pos < sizeOfArray; pos++)
{
sum = sum + array[pos];
// add grade in array position pos to sum
}
return float(sum)/sizeOfArray;
}
Notice that a set of empty brackets [ ] follows the parameter of an array which
indicates that the data type of this parameter is in fact an array. Notice also that
no brackets appear in the call to the functions that receive the array.
Since arrays in C++ are passed by pointer, which is similar to pass by reference,
it allows the original array to be altered, even though no & is used to designate
this. The getData function is thus able to store new values into the array. There
may be times when we do not want the function to alter the values of the array.
Inserting the word const before the data type on the formal parameter list pre-
vents the function from altering the array even though it is passed by pointer. This
is why in the preceding sample program the findAverage function and header
had the word const in front of the data type of the array.
float findAverage (const int array[], int sizeOfArray); // prototype
float findAverage (const int array[], int sizeOfArray) // function header
Pre-lab Reading Assignment 119
The variable numberOfGrades contains the number of elements in the array to
be processed. In most cases not every element of the array is used, which means
the size of the array given in its definition and the number of actual elements
used are rarely the same. For that reason we often pass the actual number of
ele- ments used in the array as a parameter to a procedure that uses the array.
The variable numberOfGrades is explicitly passed by reference (by using &) to
the getData function where its corresponding formal parameter is called
sizeOfArray.
Prototypes can be written without named parameters. Function headers must
include named parameters.
float findAverage (const int [], int); // prototype without named parameters
The use of brackets in function prototypes and headings can be avoided by
declaring a programmer defined data type. This is done in the global section
with a typedef statement.
Example: typedef int GradeType[50];
This declares a data type, called GradeType, that is an array containing 50 inte-
ger memory locations. Since GradeType is a data type, it can be used in defining
variables. The following defines grades as an integer array with 50 elements.
GradeType grades;
It has become a standard practice (although not a requirement) to use an upper-
case letter to begin the name of a data type. It is also helpful to include the word
“type” in the name to indicate that it is a data type and not a variable.
Sample Program 7.2 shows the revised code (in bold) of Sample Program 7.1 using
typedef.
Sample Program 7.2:
// Grade average program
// This program illustrates how one-dimensional arrays are used and how
// they are passed as arguments to functions. It contains two functions.
// The first function is called to input a set of grades and store them
// in an array. The second function is called to find the average grade.
#include <iostream>
using namespace std;
const int TOTALGRADES = 50; // maximum size of the array
// function prototypes
typedef int GradeType[TOTALGRADES]; // declaration of an integer array data type
// called GradeType
continues
120 LESSON SET 7 Arrays
void getData(GradeType array, int& sizeOfArray);
// the procedure that will read values into the array
float findAverage(const GradeType array, int sizeOfArray);
// the procedure that will find the average of values
// stored in an array. The word const in front of the
// data type of the array prevents the function from
// altering the array
int main()
{
GradeType grades; // defines an array that holds up to 50 ints
int numberOfGrades = 0; // the number of grades read in
float average; // the average of all grades read in
getData(grades, numberOfGrades);// getData is called to read the grades into
// the array and store how many grades there
// are in numberOfGrades
average = findAverage(grades, numberOfGrades);
cout << endl << "The average of the " << numberOfGrade
<< " grades read in is " << average << "." << endl << endl;
return 0;
}
//***********************************************************************
// getData
//
// task: This function inputs and stores data in the grades array.
// data in: none
// data out: an array containing grades and the number of grades
//***********************************************************************
void getData(GradeType array, int& sizeOfArray)
{
int pos = 0; // array index which starts at 0
int grade; // holds each individual grade read in
cout << "Please input a grade or type -99 to stop: " << endl;
cin >> grade;
while (grade != -99)
{
array[pos] = grade; // store grade read in to next array location
pos ++; // increment array index
cout << "Please input a grade or type -99 to stop: " << endl;
cin >> grade;
}
Pre-lab Reading Assignment 121
sizeOfArray = pos; // upon exiting the loop, pos holds the
// number of grades read in, which is sent
// back to the calling function
}
//****************************************************************************
// findAverage
//
// task: This function finds and returns the average of the values
//
// data in: the array containing grades and the array size
// data returned: the average of the grades contained in that array
//****************************************************************************
float findAverage (const GradeType array, int sizeOfArray)
{
int sum = 0; // holds the sum of all grades in the array
for (int pos = 0; pos < sizeOfArray; pos++)
{
sum = sum + array[pos];
// add grade in array position pos to sum
}
return float(sum)/sizeOfArray;
}
This method of using typedef to eliminate brackets in function prototypes and
headings is especially useful for multi-dimensional arrays such as those intro-
duced in the next section.
Two-Dimensional Arrays
Data is often contained in a table of rows and columns that can be implement-
ed with a two-dimensional array. Suppose we want to read data representing
profits (in thousands) for a particular year and quarter.
Quarter 1 Quarter 2 Quarter 3 Quarter 4
72 80 10 100
82 90 43 42
10 87 48 53
This can be done using a two-dimensional array.
Example:
const NO_OF_ROWS = 3;
const NO_OF_COLS = 4;
typedef float ProfitType[NO_OF_ROWS][NO_OF_COLS]; //declares a new data type
//which is a 2 dimensional
//array of floats
continues
122 LESSON SET 7 Arrays
int main()
{
ProfitType profit; // defines profit as a 2 dimensional array
for (int row_pos = 0; row_pos < NO_OF_ROWS; row_pos++)
for (int col_pos = 0; col_pos < NO_OF_COLS; col_pos++)
{
cout << "Please input a profit" << endl;
cin >> profit[row_pos][col_pos];
}
return 0;
}
A two dimensional array normally uses two loops (one nested inside the other)
to read, process, or output data.
How many times will the code above ask for a profit? It processes the inner
loop NO_OF_ROWS * NO_OF_COLS times, which is 12 times in this case.
Multi-Dimensional Arrays
C++ arrays can have any number of dimensions (although more than three is rarely
used). To input, process or output every item in an n-dimensional array, you
need n nested loops.
Arrays of Strings
Any variable defined as char holds only one character. To hold more than one
character in a single variable, that variable needs to be an array of characters. A
string (a group of characters that usually form meaningful names or words) is
really just an array of characters. A complete lesson on characters and strings
is given in Lesson Set 10.
PRE-LAB WRITING ASSIGNMENT
Fill-in-the-Blank Questions
1. The first subscript of every array in C++ is and the last is
less than the total number of locations in the array.
2. The amount of memory allocated to an array is based on the
and the of locations
or size of the array.
3. Array initialization and processing is usually done inside a
.
4. The statement can be used to declare an array type and
is often used for multidimensional array declarations so that when passing
arrays as parameters, brackets do not have to be used.
5. Multi-dimensional arrays are usually processed within
loops.
6. Arrays used as arguments are always passed by .
Lesson 7A 123
7. In passing an array as a parameter to a function that processes it, it is often
necessary to pass a parameter that holds the of
used in the array.
8. A string is an array of .
9. Upon exiting a loop that reads values into an array, the variable used as
a(n) to the array will contain the size of that array.
10. An n-dimensional array will be processed within nested
loops when accessing all members of the array.
LESSON 7A
LAB 7.1 Working with One-Dimensional Arrays
Retrieve program testscore.cpp from the Lab 7 folder. The code is as follows:
// This program will read in a group of test scores (positive integers from 1 to 100)
// from the keyboard and then calculate and output the average score
// as well as the highest and lowest score. There will be a maximum of 100 scores.
// PLACE YOUR NAME HERE
#include <iostream>
using namespace std;
typedef int GradeType[100]; // declares a new data type:
// an integer array of 100 elements
float findAverage (const GradeType, int); // finds average of all grades
int findHighest (const GradeType, int); // finds highest of all grades
int findLowest (const GradeType, int); // finds lowest of all grades
int main()
{
GradeType grades; // the array holding the grades.
int numberOfGrades; // the number of grades read.
int pos; // index to the array.
float avgOfGrades; // contains the average of the grades.
int highestGrade; // contains the highest grade.
int lowestGrade; // contains the lowest grade.
// Read in the values into the array
pos = 0;
cout << "Please input a grade from 1 to 100, (or -99 to stop)" << endl;
continues
124 LESSON SET 7 Arrays
cin >> grades[pos];
while (grades[pos] != -99)
{
// Fill in the code to read the grades
}
numberOfGrades = ; // Fill blank with appropriate identifier
// call to the function to find average
avgOfGrades = findAverage(grades, numberOfGrades);
cout << endl << "The average of all the grades is " << avgOfGrades << endl;
// Fill in the call to the function that calculates highest grade
cout << endl << "The highest grade is " << highestGrade << endl;
// Fill in the call to the function that calculates lowest grade
// Fill in code to write the lowest to the screen
return 0;
}
//********************************************************************************
// findAverage
//
// task: This function receives an array of integers and its size.
// It finds and returns the average of the numbers in the array
// data in: array of floating point numbers
// data returned: average of the numbers in the array
//
//********************************************************************************
float findAverage (const GradeType array, int size)
{
float sum = 0; // holds the sum of all the numbers
for (int pos = 0; pos < size; pos++)
sum = sum + array[pos];
return (sum / size); //returns the average
}
Lesson 7A 125
//****************************************************************************
// findHighest
//
// task: This function receives an array of integers and its size.
// It finds and returns the highest value of the numbers in the array
// data in: array of floating point numbers
// data returned: highest value of the numbers in the array
//
//****************************************************************************
int findHighest (const GradeType array, int size)
{
/ Fill in the code for this function
}
//****************************************************************************
// findLowest
//
// task: This function receives an array of integers and its size.
// It finds and returns the lowest value of the numbers in the array
// data in: array of floating point numbers
// data returned: lowest value of the numbers in the array
//
//****************************************************************************
int findLowest (const GradeType array, int size)
{
// Fill in the code for this function
}
Exercise 1: Complete this program as directed.
Exercise 2: Run the program with the following data: 90 45 73 62 -99
and record the output here:
Exercise 3: Modify your program from Exercise 1 so that it reads the informa-
tion from the gradfile.txt file, reading until the end of file is encoun-
tered. You will need to first retrieve this file from the Lab 7 folder and
place it in the same folder as your C++ source code. Run the program.
126 LESSON SET 7 Arrays
Lab 7.2 Strings as Arrays of Characters
Retrieve program student.cpp from the Lab 7 folder.
// This program will input an undetermined number of student names
// and a number of grades for each student. The number of grades is
// given by the user. The grades are stored in an array.
// Two functions are called for each student.
// One function will give the numeric average of their grades.
// The other function will give a letter grade to that average.
// Grades are assigned on a 10 point spread.
// 90-100 A 80-89 B 70-79 C 60-69 D Below 60 F
// PLACE YOUR NAME HERE
#include <iostream>
#include <iomanip>
using namespace std;
const int MAXGRADE = 25; // maximum number of grades per student
const int MAXCHAR = 30; // maximum characters used in a name
typedef char StringType30[MAXCHAR + 1];// character array data type for names
// having 30 characters or less.
typedef float GradeType[MAXGRADE]; // one dimensional integer array data type
float findGradeAvg(GradeType, int); // finds grade average by taking array of
// grades and number of grades as parameters
char findLetterGrade(float); // finds letter grade from average given
// to it as a parameter
int main()
{
StringType30 firstname, lastname;// two arrays of characters defined
int numOfGrades; // holds the number of grades
GradeType grades; // grades defined as a one dimensional array
float average; // holds the average of a student's grade
char moreInput; // determines if there is more input
cout << setprecision(2) << fixed << showpoint;
// Input the number of grades for each student
cout << "Please input the number of grades each student will receive." << endl
<< "This must be a number between 1 and " << MAXGRADE << " inclusive”
<< endl;
cin >> numOfGrades;
Lesson 7A 127
while (numOfGrades > MAXGRADE || numOfGrades < 1)
{
cout << "Please input the number of grades for each student." << endl
<< "This must be a number between 1 and " << MAXGRADE
<< " inclusiven";
cin >> numOfGrades;
}
// Input names and grades for each student
cout << "Please input a y if you want to input more students"
<< " any other character will stop the input" << endl;
cin >> moreInput;
while (moreInput == 'y' || moreInput == 'Y')
{
cout << "Please input the first name of the student" << endl;
cin >> firstname;
cout << endl << "Please input the last name of the student" << endl;
cin >> lastname;
for (int count = 0; count < numOfGrades; count++)
{
cout << endl << "Please input a grade" << endl;
// Fill in the input statement to place grade in the array
}
cout << firstname << " " << lastname << " has an average of ";
// Fill in code to get and print average of student to screen
// Fill in call to get and print letter grade of student to screen
cout << endl << endl << endl;
cout << "Please input a y if you want to input more students"
<< " any other character will stop the input" << endl;
cin >> moreInput;
}
return 0;
}
continues
128 LESSON SET 7 Arrays
//***********************************************************************
// findGradeAvg
//
// task: This function finds the average of the
// numbers stored in an array.
//
// data in: an array of integer numbers
// data returned: the average of all numbers in the array
//
//***********************************************************************
float findGradeAvg(GradeType array, int numGrades)
{
// Fill in the code for this function
}
//***********************************************************************
// findLetterGrade
//
// task: This function finds the letter grade for the number
// passed to it by the calling function
//
// data in: a floating point number
// data returned: the grade (based on a 10 point spread) based on the number
// passed to the function
//
//***********************************************************************
char findLetterGrade(float numGrade)
{
// Fill in the code for this function
}
Exercise 1: Complete the program by filling in the code. (Areas in bold)
Run the program with 3 grades per student using the sample data below.
Mary Brown 100 90 90
George Smith 90 30 50
Dale Barnes 80 78 82
Sally Dolittle 70 65 80
Conrad Bailer 60 58 71
You should get the following results:
Mary Brown has an average of 93.33 which gives the letter grade of A
George Smith has an average of 56.67 which gives the letter grade of F
Dale Barnes has an average of 80.00 which gives the letter grade of B
Sally Dolittle has an average of 71.67 which gives the letter grade of C
Conrad Bailer has an average of 63.00 which gives the letter grade of D
Lesson 7B 129
LESSON 7B
LAB 7.3 Working with Two-Dimensional Arrays
Look at the following table containing prices of certain items:
12.78 23.78 45.67 12.67
7.83 4.89 5.99 56.84
13.67 34.84 16.71 50.89
These numbers can be read into a two-dimensional array.
Retrieve price.cpp from the Lab 7 folder. The code is as follows:
// This program will read in prices and store them into a two-dimensional array.
// It will print those prices in a table form.
// PLACE YOUR NAME HERE
#include <iostream>
#include <iomanip>
using namespace std;
const MAXROWS = 10;
const MAXCOLS = 10;
typedef float PriceType[MAXROWS][MAXCOLS]; // creates a new data type
// of a 2D array of floats
void getPrices(PriceType, int&, int&); // gets the prices into the array
void printPrices(PriceType, int, int); // prints data as a table
int main()
{
int rowsUsed; // holds the number of rows used
int colsUsed; // holds the number of columns used
PriceType priceTable; // a 2D array holding the prices
getPrices(priceTable, rowsUsed, colsUsed); // calls getPrices to fill the array
printPrices(priceTable, rowsUsed, colsUsed);// calls printPrices to display array
return 0;
}
continues
130 LESSON SET 7 Arrays
//*******************************************************************************
// getPrices
//
// task: This procedure asks the user to input the number of rows and
// columns. It then asks the user to input (rows * columns) number of
// prices. The data is placed in the array.
// data in: none
// data out: an array filled with numbers and the number of rows
// and columns used.
//
//*******************************************************************************
void getPrices(PriceType table, int& numOfRows, int& numOfCols)
{
cout << "Please input the number of rows from 1 to "<< MAXROWS << endl;
cin >> numOfRows;
cout << "Please input the number of columns from 1 to "<< MAXCOLS << endl;
cin >> numOfCols;
for (int row = 0; row < numOfRows; row++)
{
for (int col = 0; col < numOfCols; col++)
// Fill in the code to read and store the next value in the array
}
}
//***************************************************************************
// printPrices
//
// task: This procedure prints the table of prices
// data in: an array of floating point numbers and the number of rows
// and columns used.
// data out: none
//
//****************************************************************************
void printPrices(PriceType table, int numOfRows, int numOfCols)
{
cout << fixed << showpoint << setprecision(2);
for (int row = 0; row < numOfRows; row++)
{
for (int col = 0; col < numOfCols; col++)
// Fill in the code to print the table
}
}
Lesson 7B 131
Exercise 1: Fill in the code to complete both functions getPrices and
printPrices, then run the program with the following data:
Exercise 2: Why does getPrices have the parameters numOfRows and
numOfCols passed by reference whereas printPrices has those parameters
passed by value?
Exercise 3: The following code is a function that returns the highest price in
the array. After studying it very carefully, place the function in the above
program and have the program print out the highest value.
float findHighestPrice(PriceType table, int numOfRows, int numOfCols)
// This function returns the highest price in the array
{
float highestPrice;
highestPrice = table[0][0]; // make first element the highest price
for (int row = 0; row < numOfRows; row++)
for (int col = 0; col < numOfCols; col++)
if ( highestPrice < table[row][col] )
highestPrice = table[row][col];
return highestPrice;
}
continues
132 LESSON SET 7 Arrays
NOTE: This is a value returning function. Be sure to include its prototype
in the global section.
Exercise 4: Create another value returning function that finds the lowest price
in the array and have the program print that value.
Exercise 5: After completing all the exercises above, run the program again
with the values from Exercise 1 and record your results.
Exercise 6: (Optional) Look at the following table that contains quarterly sales
transactions for three years of a small company. Each of the quarterly
transactions are integers (number of sales) and the year is also an integer.
YEAR Quarter 1 Quarter 2 Quarter 3 Quarter 4
2000 72 80 60 100
2001 82 90 43 98
2002 64 78 58 84
We could use a two-dimensional array consisting of 3 rows and 5 columns.
Even though there are only four quarters we need 5 columns (the first
column holds the year).
Retrieve quartsal.cpp from the Lab 7 folder. The code is as follows:
// This program will read in the quarterly sales transactions for a given number
// of years. It will print the year and transactions in a table format.
// It will calculate year and quarter total transactions.
// PLACE YOUR NAME HERE
#include <iostream>
#include <iomanip>
using namespace std;
const MAXYEAR = 10;
const MAXCOL = 5;
typedef int SalesType[MAXYEAR][MAXCOL]; // creates a new 2D integer data type
void getSales(SalesType, int&); // places sales figures into the array
void printSales(SalesType, int); // prints data as a table
void printTableHeading(); // prints table heading
int main()
{
int yearsUsed; // holds the number of years used
SalesType sales; // 2D array holding
// the sales transactions
getSales(sales, yearsUsed); // calls getSales to put data in array
Another Random Scribd Document
with Unrelated Content
He watched Lola hand a letter to the stranger, and wish him
“Addio e buon viaggio!”
Then he followed the bearded man down to the station,
where, from a European official of whom he made a
confidential inquiry, he learnt that the stranger had arrived
in Assouan from Cairo only two hours before, bearing a
return ticket to Europe by the mail route via Port Said and
Brindisi.
With curiosity he watched the Italian leave by the mail for
Cairo ten minutes later, and then turned away and retraced
his steps to the Cataract Hotel, plunged deep in thought.
There was a mystery somewhere—a strange and very grave
mystery.
What could be that message of such extreme importance
and secrecy that it could not be trusted to the post?
Who was old Gigleux of whom Mademoiselle Duprez went in
such fear? Was she really what she represented herself to
be?
No. He felt somehow assured that all was not as it should
be. A mystery surrounded both uncle and niece, while the
angular Miss Lambert remained as silent and impenetrable
as the sphinx.
Diplomat and man of the world as was Hubert Waldron—a
man who had run the whole gamut of life in the gay centres
of Europe—he was naturally suspicious, for the incident of
that night seemed inexplicable.
Something most secret and important must be in progress
to necessitate the travelling of a special messenger from
Europe far away into Upper Egypt, merely to deliver a letter
and obtain a response.
“Yes,” he murmured to himself as he passed through the
portals of the hotel, which were thrown open to him by two
statuesque Nubian servants, who bowed low as he passed.
“Yes; there are some curious features about this affair. I will
watch and discover the truth. Lola is in some secret and
imminent peril. Of that I feel absolutely convinced.”
Chapter Three.
In the Holy of Holies.
Five days later.
Boulos, the faithful Egyptian dragoman, in his red fez and
long caftan of yellow silk reaching to his heels, stood
leaning over the bows of the small white steamer which was
slowly wending its way around the many curves of the
mighty river which lay between the Island of Philae and the
Second Cataract at Wady Haifa, the gate of the Sudan.
No railway runs through that wild desert of rock and sand,
and the road to Khartoum lies by water over those sharp
rocks and ever-shifting shoals where navigation is always
dangerous, and progress only possible by daylight.
Boulos, the dark, pleasant-faced man who is such an
inveterate gossip, who knows much more of Egyptology
than his parrot-talk to travellers, and who is popular with all
those who go to and fro between Cairo and Khartoum,
stood chatting in Arabic with the white-bearded, black-faced
reis, or pilot.
The latter, wearing a white turban, was wrapped in a red
cloak though the sun was blazing. He squatted upon a piece
of carpet in the bows, idly smoking a cigarette from dawn
till sundown, and navigating the vessel by raising his right
or left hand as signal to the man at the helm.
A Nile steamer has no captain. The Nubian reis is supreme
over the native crew, and being a man of vast experience of
the river, knows by the appearance of the water where lie
the ever-shifting sand-banks.
“Oh yes,” remarked the reis in Arabic; “by Allah’s grace we
shall anchor at Abu Simbel by sunset. It is now just past the
noon,” added the bearded old man—who looked like a
prophet—as he glanced upward at the burning sun.
“And when shall we leave?” asked the dragoman.
“At noon to-morrow—if Allah willeth it,” replied the old man.
“To-night the crew will give a fantasia. Will you tell the
passengers.”
“If it be thy will,” responded Boulos, drawing at his excellent
cigarette.
“How farest thou this journey?”
“Very well. The Prophet hath given me grace to sell several
statuettes and scarabs. The little American hath bought my
bronze of Isis.”
“I congratulate thee, O wise one among the infidels,”
laughed the old man, raising his left hand to alter the
course of the vessel. “Thy bronze hath lain for many moons
—eh?”
“Since the last Ramadan. And now, with Allah’s help, I have
sold it to the American for a thousand piastres.”
Old Melek the reis grunted, and thoughtfully rolled another
cigarette, which he handed unstuck to his friend, the sign of
Arab courtesy. Boulos ran his tongue along it, and raising
his hand to his fez in thanks, lit it with great gusto, glancing
up to the deck where his charges were lolling beneath the
awning.
Lola, in white, and wearing her sun-helmet, leaned over the
rail and called in her broken English:
“Boulos, when do we arrive at Abu Simbel?”
“At ze sunset, mees,” was the dragoman’s smiling reply.
“To-morrow morning, at haf-pas tree we land, and we watch
ze sun rise from inside ze gr-reat Tem-pel of Rameses.”
Then raising his voice, so that all could hear, as is the habit
of dragomans: “Ze gr-reat Tem-pel is cut in ze rock and
made by Rameses to hees gr-reat gawd, Ra, gawd of ze
sun. In ze front are fo-our colossi—gr-reat carved statues of
Rameses seated. Zees, la-dees and gen’lemens, you will be
able to see first as we come round ze bend of ze Nile about
seex o’clock. To-morrow morning we land at haf-pas tree,
and ze sight is one of ze grandest in all our Egypt.”
“Half-past three!” echoed Chester Dawson, who was sitting
in a deck-chair at Edna’s side. “I shall still be in my berth, I
hope. No Temple of Rameses would get me up before
sunrise.”
“Say, you’re real lazy,” declared the buxom American girl.
“I’ll be right there—you bet.”
“But is the old ruin worth it? We’ve seen the wonderful
works of Rameses all up the Nile.”
“Waal—is it worth coming to Egypt at all?” she asked in her
native drawl. “Guess it is—better than Eu-rope—even if
you’re fed up by it.”
“Oh, I don’t know. This beastly heat makes me sick,” and he
gave a vigorous stroke with his horsehair fly-whisk with
which each traveller was provided. Beelzebub assuredly
lived in Egypt, for was he not the god of flies. Everything
has a god in Egypt.
Boulos had resumed his comfortable chat with Melek, the
reis. His thousand piastre deal of that morning had fully
satisfied him. Not that he ever overcharged the travellers
for any antiques which he sold them. As everyone on the
Nile knows—from Cairo to far Khartoum—Boulos the
laughing, easy-going though gorgeously attired dragoman,
is a scrupulously honest dealer. He is a friend of the
greatest Egyptologists in the world and, unlike the common
run of dragomans, has studied Egyptian history, and
possesses quite a remarkable knowledge of hieroglyphics.
Many a well-known European professor has sat at the knee
of Boulos, and many an antique is now in one or other of
the European national collections which originally passed
through the hands of the ever-faithful Boulos.
Waldron was sipping an innocuous drink composed of Evian
water with a lime squeezed into it, and chatting in French
with old Jules Gigleux, passing one of those usual mornings
of laziness, away from the worries of letters and
newspapers, which are so delightful up the Nile.
Beneath the wide awning the soft, hot breeze pleasantly
fanned them, while away on the banks rose the feathery
palms on the tiny green strip of cultivated mud, sometimes
only a few feet in width, and then the desert—that great
glaring waste of brown sand—stretching away to the
horizon where the sky shone like burnished copper.
Mademoiselle, as full of mischief as ever, was the very life
and soul of that smart party of moneyed folk which included
two English peers, three American millionaires, an Austrian
banker, a wealthy Russian prince, and two Members of
Parliament who had paired. It had been whispered that she
was daughter of Duprez, the millionaire sugar-refiner of
Lyons; and, as everyone knows, the sugar of the Maison
Duprez is used in nearly every household throughout
France.
Yet Waldron had heard quite a different story from her own
lips while they had been seated together on deck the
previous evening drinking coffee.
“Ah?” she had sighed, “if I were only wealthy like the
several other girls of this party, it would be different.
Perhaps I could break away from uncle, and remain
independent. But, alas! I cannot. I owe everything to him—I
am dependent upon him for all I have.”
This surprised Hubert considerably. Hitherto he had believed
her to be the daughter of a wealthy man, because Miss
Lambert showed her such marked deference. But such
apparently was not the fact. Indeed she had declared later
on to Waldron that she was very poor, and to her eccentric
old uncle she was indebted for everything she received.
Hers was a curious, complex character. Sometimes she
would sit and chat and flirt violently with him—for by her
woman’s intuition she knew full well that he admired her
greatly—while at others she would scarcely utter a word to
him.
Hubert Waldron detested old Gigleux. Even though he sat
chatting and laughing with him that morning, he held him in
supreme contempt for his constant espionage upon his
niece. The old fellow seemed ubiquitous. He turned up in
every corner of the steamer, always feigning to take no
notice of his niece’s constant companionship with the
diplomat, and yet his sharp, shrewd eyes took in
everything.
On more than one occasion the Englishman was upon the
point of demanding outright why that irritating observation
was so constantly kept, nevertheless with a diplomat’s
discretion, he realised that a judicious silence was best.
That long, blazing day passed slowly, till at last the sun
sank westward over the desert in a flame of green and gold.
Then the thirty or so passengers stood upon the deck
waiting in patience till, suddenly rounding the sharp bend of
the river, they saw upon the right—carved in the high,
sandstone cliff—the greatest and most wonderful sight in all
Nubia.
Lola was at the moment leaning over the rail, while Waldron
stood idly smoking at her side.
“See!” he cried suddenly. “Over there! Those four colossal
seated figures guarding the entrance of the temple which
faces the sunrise. That is Abu Simbel.”
“How perfectly marvellous!” gasped the girl, astounded at
the wonderful monument of Rameses the Great.
“The temple is hewn in the solid rock—a temple about the
size of Westminster Abbey in London. In the Holy of holies
are four more seated figures in the darkness, and to-
morrow as we stand in there at dawn, the sun, as it rises,
will shine in at the temple door and gradually light up the
faces of those images, until they glow and seem to become
living beings—surely the most impressive sight of all the
wonders of Egypt.”
“I am longing to see it,” replied the girl, her eyes fixed in
fascination at the far-off colossi seated there gazing with
such calm, contented expression over the Nile waters, now
blood-red in the still and gorgeous desert sunset.
On the arid banks there was no sign of life, or even of
vegetation. All was desert, rock, sand, and desolation.
Where was the great, palpitating civilisation which had
existed there in the days of Rameses, the cultured world
which worshipped the great god, Ra, in that most wonderful
of all temples? Gone, every trace save the place where the
sun god was worshipped, swept out of existence, effaced,
and forgotten.
Over the vessel a great grey vulture hovered with slowly
flapping wings. Then from the bows came a low chant, and
the passengers craning their necks below, saw that the
black-faced crew had turned towards Mecca and sunk upon
their knees, including even the gorgeous Boulos himself,
and with many genuflexions were adoring Allah.
“Allah is great. Allah is merciful. He is the One,” they cried
in their low, musical Arabic. “There is no god but Allah!”
The sun sank and twilight came swiftly, as it does in the
glowing, mystic East. And the white-bearded reis, his
prayers finished, pushed on the steamer more quickly so as
to anchor opposite Abu Simbel before darkness fell. The
excitement among the passengers grew intense, for, on the
morrow, ere the first pink of the dawn, the travellers were
to stand within that rock-hewn temple, the most wonderful
of all the works of the Pharaohs.
The evening proved a merry one, for after dinner, with the
vessel anchored in mid-stream—to obviate thieves—
opposite the great temple, the Nubian crew gave a fantasia,
or native song and dance, for the benefit of the travellers.
On each trip from Shellal to Wady Haifa this was usual, for
European travellers like to hear the weird native music, and
the crooning desert songs in which Allah is praised so
incessantly. Besides, a collection is made afterwards, and
the sturdy, hard-working crew are benefited by many
piastres.
On the lower deck, beneath the brilliant stars the black-
faced toilers of the Nile beat their tom-toms vigorously and
chanted weirdly while the passengers stood leaning over,
watching and applauding. The crew squatted in a circle, and
one after the other sprang up and performed a wild, mad
dance while their companions kept time by clapping their
hands or strumming upon their big earthenware tom-toms.
Then at eleven, the hour when the dynamos cease their
humming and the electric light goes out, the concert ended
with all the crew—headed by the venerable, white-bearded
old pilot—standing up, salaaming and crying in their broken
English:
“Gud nites, la-dees and gen’lemens. Gud nites?”
It was just before three on the following morning when the
huge gong, carried around by an Arab servant, aroused
everyone, and very soon from most of the cabins there
turned out sleepy travellers who found the black giant
Hassan ready with his little cups of delicious black coffee.
Boulos was there, already gorgeous in a pale green silk
robe, while the steamer had half an hour before moved up
to the landing-place.
“La-dees and gen’lemens!” cried the dragoman in his loud,
drawling tone, “we no-ow go to see ze gree-at tem-pel of ze
gawd, Ra—gawd of ze sun—ze tem-pel of ze sun-rise and ze
greatest monument in all our Eg-eept. We shall start in fif
mineets. In fif mineets, la-dees. Monuments tick-eets ve-ry
much wanted. No gallopin’ donkeys in Abu Simbel!”
Whereat there was a laugh.
Then the under-dragoman, a person in a less gorgeous
attire, proceeded to make up a parcel of candles, matches,
and magnesium wire, and presently the travellers, all of
whom had hastily dressed, followed their guide on shore,
and over the tiny strip of cultivated mud until they came to
the broad stone steps which led from the Nile bank to the
square doorway of the temple.
Here a number of candles were lit by the under-dragoman;
and Waldron, taking one, escorted Lola and Miss Lambert.
Within, they found a huge, echoing temple with high
columns marvellously carved and covered by hieroglyphics
and sculptured pictures.
Through one huge chamber after another they passed, the
vaulted roof so high that the light of their candles did not
reach to it. Only could it be seen when the magnesium wire
was burned, and then the little knot of travellers stood
aghast in wonder at its stupendous proportions.
At last they stood in the Holy of holies—a small, square
chamber at the extreme end.
In the centre stood the altar for the living sacrifices, the
narrow groves in the stones telling plainly their use—the
draining off of the blood.
All was darkness. Only Boulos spoke, his drawling, parrot-
like voice explaining many intensely interesting facts
concerning that spot where Rameses the Great worshipped
the sun god.
Then there was a dead silence. Not one of that gay,
chattering company dared to speak, so impressive and awe-
inspiring was it all.
Suddenly, from out of the darkness they saw before them
slowly, yet distinctly, four huge figures seated, their hands
lying upon their knees, gradually come into being as the
sun’s faint pink rays, entering by the door, struck upon their
stone faces, infusing life into their sphinx-like countenances
until they glowed and seemed almost to speak.
Expressions of amazement broke from everyone’s lips.
“Marvellous!” declared Lola in an awed whisper. “Truly they
seem really to live. It is astounding.”
“Yes,” answered Waldron. “And thus they have lived each
morning in the one brief hour of the sunrise through all the
ages. From Rameses to Cleopatra each king and queen of
Egypt has stood upon this spot and worshipped their great
gods, Ra and the all-merciful Osiris. Such a sight as this
surely dwarfs our present civilisation, and should bring us
nearer to thoughts of our own Christian God—the Almighty.”
Chapter Four.
Contains a Bitter Truth.
When Hubert returned on board the Arabia and entered his
deck-cabin, one of a long row of small cubicles, he started
back in surprise, for Gigleux was there.
The Frenchman was confused at his sudden discovery, but
only for a second. Then, with his calm, pleasant smile, he
said in French:
“Ah, m’sieur, a thousand pardons! I was looking for the
book I lent you the other day—that book of Maspero’s. I
want to refer to it.”
Waldron felt at once that the excuse was a lame one.
“I left it in the fumoir last night, I believe.”
“Ah! Then I will go and get it,” replied the white-haired old
fellow fussily. “But I hope,” he added, “that m’sieur will
grant pardon for this unwarrantable intrusion. I did not go
to the temple. It was a trifle too early for me.”
“You missed a great treat,” replied the Englishman bluntly,
tossing his soft felt hat upon his narrow little bed.
“Mademoiselle will tell you all about it.”
“You took her under your charge—as usual, eh?” sniffed the
old fellow.
“Oh, yes. I escorted both her and Miss Lambert,” was the
diplomat’s reply. “But look here, M’sieur Gigleux,” he went
on, “you seem to have a distinct antipathy towards me. You
seem to be averse to any courtesy I show towards your
niece. Why is this? Tell me.”
The old man’s eyes opened widely, and he struck an
attitude.
“Mais non, m’sieur!” he declared quickly. “You quite
misunderstand me. I am old—and perhaps I may be a little
eccentric. Lola says that I am.”
“But is that any reason why I should not behave with
politeness to mam’zelle?”
The old man with the closely cropped white hair paused for
a few seconds. That direct question nonplussed him. He
drew a long breath, and as he did so the expression upon
his mobile face seemed to alter.
In the silence Hubert Waldron was leaning against the edge
of the little mosquito-curtained bed, while the Frenchman
stood in the narrow doorway, for, in that little cabin, there
was only sufficient room for one person to move about
comfortably.
“Yes,” responded the girl’s uncle. “Now that you ask me this
very direct question I reply quite frankly that there is a
reason—a very strong and potent reason why you, a man
occupying an official position in the British diplomacy should
show no undue courtesy to Mademoiselle Lola.”
“Why?” asked Hubert, much surprised.
“For several reasons. Though, as I expect she has already
explained to you, she is a penniless orphan, daughter of my
sister, whose wealthy husband lost every sou in the failure
of the banking firm of Chenier Frères of Marseilles. I have
accepted the responsibility of her education and I have
already planned out her future.”
“A wealthy husband, I suppose,” remarked the Englishman
in a hard voice.
“M’sieur has guessed the truth.”
“And she is aware of this?”
“Quite,” was the old man’s calm reply. “Therefore you now
know the reason why I am averse to your attentions.”
“Well, at least you are frank,” declared the other with a
laugh. “But I assure you, M’sieur Gigleux, that I have no
matrimonial intentions whatsoever. I’m a confirmed
bachelor.”
Gigleux shook his head wisely.
“When a girl of Lola’s bright and irresponsible disposition is
thrown hourly into the society of a man such as yourself,
my dear friend, there is danger—always a grave danger.”
“And is she fond of this man whom you have designated as
her husband?”
“Nowadays girls marry for position—not for love,” he
grunted.
“In France, yes—but scarcely so in England,” Waldron
retorted, his anger rising.
“Well, m’sieur, you have asked me a question, and I have
replied,” the Frenchman said. “I trust that this open
conversation will make no difference to our friendship,
though I shall take it as a personal favour if, in the future,
you will not seek Lola’s society quite so much.”
“As you wish, m’sieur,” replied the diplomat savagely. He
hated the crafty, keen-eyed old fellow and took no pains
now to conceal his antipathy.
The blow which he had for the past fortnight expected had
fallen. He intended at the earliest moment to seek Lola, and
inquire further into the curious situation, for if the truth be
told, he had really fallen deeply in love with her, even
though she might be penniless and dependent upon the old
man.
When old Gigleux had passed along the deck he sat down
upon the bed and lighting a cigarette, reflected. He was a
younger son with only seven hundred a year in addition to
his pay from the Foreign Office. Madrid was an expensive
post. Indeed, what European capital is not expensive to the
men whose duty it is to keep up the prestige of the British
Empire abroad? Diplomacy, save for the “plums,” is an ill-
paid profession, for entertaining is a constant drain upon
one’s pocket, as every Foreign Office official, from the
poverty-stricken Consul to the Ambassador, harassed by
debt, can, alas! testify.
Many an Ambassador to a foreign Court has been ruined by
the constant drain of entertaining. Appearances and social
entertainments are his very life, and if he cuts down his
expenses Britain’s prestige must suffer, and at Downing
Street they will quickly query the cause of his parsimony. So
the old game goes on, and the truth is, that many a man of
vast diplomatic experience and in a position of high
responsibility is worse off in pocket than the average
suburban tradesman.
Hubert Waldron bit his lip. After all, he was a fool to allow
himself to think of her. No diplomat should marry until he
became appointed Minister, and a bachelor life was a
pleasant one. Curious, he thought, that he, a man who had
run the whole gamut of life in the capitals, and who had
met so many pretty and fascinating women in that gay
world which revolves about the Embassies, should become
attracted by that merry little French girl, Lola Duprez.
Breakfast over, the party went ashore again, now in linen
clothes and sun-helmets, to wander about the temple till
noon, when they were to leave for Wady Haifa.
He saw Lola and Edna Eastham walking with Chester
Dawson, so, following, he joined them and at last secured
an opportunity of speaking with Lola alone.
They were strolling slowly around the edge of the sandstone
cliff, away from the colossal façade of the temple, and out
of sight of the steamer, for the old Frenchman had
fortunately still remained on board—the blazing heat being
too much for him.
“Lola,” her companion exclaimed, “I have spoken to your
uncle quite openly this morning. I know that he hates me.”
She turned quickly and looked straight at him with her
wonderful dark eyes.
“Well—?” she asked.
“He has told me the truth,” Waldron went on seriously. “He
has explained that the reason he objects to our
companionship is because you are already betrothed.”
“Betrothed?” she echoed, staring at him.
“Yes. To whom? Tell me, mam’zelle,” he asked slowly.
She made no response. Her eyes were downcast; her
cheeks suddenly pale. They were standing beneath the
shadow of an ancient wide-spreading tree which struggled
for existence at the edge of the Nile flood.
“He has said that I am betrothed—eh?” she asked, as
though speaking to herself.
“He has told me so. Your future husband has been already
chosen,” he said in a low, mechanical tone.
Her teeth were set, her sweet, refined countenance had
grown even paler.
“Yes,” she admitted at last, drawing a deep breath. “My past
has been bright and happy, but, alas! before me there now
only lies tragedy; and despair. Ah! if I were but my own
mistress—if only I could escape this grip of evil which is
ever upon me!”
“Grip of evil! What do you mean?” he inquired eagerly.
“Ah! you do not know—you can never tell!” she cried. “The
evil hand of Jules Gigleux is ever upon me, a hard, iron,
inexorable hand. Ah! M’sieur Waldron, you would, if you
only knew the truth, pity a woman who is in the power of a
man of that stamp—a man who has neither feeling, nor
conscience, neither human kindness nor remorse.”
“He’s a confounded brute—that I know. I feel sure of it,” her
companion declared hastily. “But look here, mam’zelle, can’t
I assist you? Can’t I help you out of this pitfall into which
you seem to have fallen. Why should you be forced to
marry this man whom your uncle has chosen—whoever he
may be?”
She shook her head mournfully, her lips quite white.
“No,” she sighed. “I fear your efforts could have no avail. It
is true that I am betrothed—pledged to a man whom I hate.
But I know that I cannot escape. I must obey the decree
which has gone forth. Few girls to-day marry for love, I fear
—and true love, alas! seems ever to bring poverty in its
wake.”
“That’s the old sentimental way of looking at it,” he
declared. “There’s many a rich marriage in which Cupid
plays the principal part. I’ve known lots.”
“In my case it cannot be,” the girl declared hopelessly. “My
future has been planned for me, and admits of no
alteration,” she went on. “To me, love—the true love of a
woman towards a man—is forbidden. My only thought is to
crush it completely from my heart and to meet my future
husband as I would a dire misfortune.”
“Not a very cheerful outlook, I fear.”
“No, my future can, alas! be only one of tragedy, M’sieur
Waldron, so the less we discuss it the better. It is, I assure
you, a very painful subject,” and again she sighed heavily,
and he saw hot tears welling in those splendid eyes which
he always admired so profoundly.
Her face was full of black tragedy, and as Waldron gazed
upon it his heart went out in deepest sympathy towards her.
“But surely this uncle of yours is not such an absolute brute
as to compel you to wed against your will!” he cried.
“Not he alone compels me. There are other interests,” was
her slow reply, her voice thick with suppressed emotion. “I
am bound, fettered, hand and foot. Ah! you do not know!”
she cried.
“Cannot I assist you to break these fetters?” he asked,
bending to her earnestly. “I see that you are suffering, and
if I can do anything to serve your interests I assure you,
mademoiselle, I will.”
“I feel certain of that,” was her answer. “Already you have
been very good and patient with me. I know I have often
sorely tried your temper. But you must forgive me. It is my
nature, I fear, to be mischievous and irresponsible.”
At that instant the recollection of the night in Assouan
crossed Waldron’s mind—of that mysterious messenger who
had come post-haste from Europe, and had as mysteriously
returned. He had never mentioned the affair, for had he
done so she would have known that he had spied upon her.
Therefore he had remained silent.
They stood together beneath the shade of that spreading
tree with the heat of the desert sand reflected into their
faces—stood in silence, neither speaking.
At last he said:
“And may I not know the identity of the man who is marked
out to be your husband?”
“No; that is a secret, M’sieur Waldron, which even you must
not know. It is my affair, and mine alone,” she replied in a
low tone.
“I’m naturally most curious,” he declared, “for if I can assist
you to extricate yourself from this impasse I will.”
“I thank you most sincerely,” was her quick response, as
she looked up at him with her soft, big eyes. “If at any time
I require your assistance I will certainly count upon you.
But, alas! I fear that no effort on your part could avail me.
There are reasons—reasons beyond my control—which
make it imperative that I should marry the man marked out
for me.”
“It’s a shame—a downright sin!” he cried fiercely. “No,
mademoiselle,” and he grasped her small hand before she
could withdraw it; “I will not allow you to sacrifice yourself
to your uncle’s whim.”
She shook her head slowly, answering:
“It is, alas! not within your power to prevent it! The matter
has already been arranged.”
“Then you are actually betrothed?”
“Yes,” she replied in a hoarse voice. “To a man I hate.”
“Then you must let me act on your behalf. I must—I will?”
“No. You can do nothing to help me. As I have already
explained, my life in future can only be one of tragedy—just
as yours may be, I fear,” she added in a slow, distinct voice.
“I hardly follow you,” he exclaimed, looking at her much
puzzled.
She smiled sadly, turning her big eyes upon his.
“Probably not,” she said. “But does not half Madrid know the
tragedy of your love for the dancer, Beatriz Rojas de Ruata,
the beautiful woman whose misfortune it is to have a
husband in the person of a drunken cab-driver.”
“What!” he gasped, starting and staring at her in
amazement. “Then you know Madrid?”
“Yes, I have been in Madrid,” was her answer. “And I have
heard in the salons of your mad infatuation for the beautiful
opera-dancer. It is common gossip, and most people sigh
and sympathise with you, for it is known, too, that Hubert
Waldron, of the British Embassy, is the soul of honour—and
that such love as his can only bring tragedy in its train.”
“You never told me that you had been in Madrid!”
“Because you have never asked me,” was her calm reply.
“But I know much more concerning you, M’sieur Waldron,
than you believe,” she said with a mysterious smile. Then,
her eyes glowing, she added: “I have heard you discussed
in Madrid, in Barcelona, and in San Sebastian, and I know
that your love for the beautiful Beatriz Rojas de Ruata is
just as fraught with tragedy as the inexorable decree which
may, ere long, bind me as wife to the one man whom I hate
and detest most in all the world!”
Chapter Five.
A Surprise.
Egypt is the strangest land, the weirdest land, the saddest
land in all the world.
It is a land of memories, of monuments, and of mysticism;
a land of dreams that never come true, a land of mystery, a
great cemetery stretching from ancient Ethiopia away to the
sea, a great grave hundreds of miles long in which is buried
perhaps as many millions of human beings as exist upon
our earth to-day.
Against the low-lying shore of the great Nile valley have
beaten many of the greatest waves of human history. It is
the grave of a hundred dead Egypts, old and forgotten
Egypts, that existed and possessed kings and priests and
rules and creeds, and died and were succeeded by newer
Egypts that now, too, are dead, that in their time believed
they reared permanently above the ruins of the past.
The small white steamer lay moored in the evening light at
the long stone quay before the sun-baked town of Wady
Haifa, close to the modern European railway terminus of the
long desert-line to Khartoum.
On board, dinner was in progress in the cramped little
saloon, no larger than that of a good-sized yacht, and
everyone was in high spirits, for the Second Cataract, a
thousand miles from Cairo, had at last been reached.
Amid the cosmopolitan chatter in French, English, Italian
and German, Boulos, arrayed in pale pink silk—for the
dragoman is ever a chameleon in the colour of his perfumed
robes—made his appearance and clapped his hands as
signal for silence.
“La-dees and gen’lemens,” he cried in his long-drawn-out
Arab intonation, “we haf arrived now in Wady Haifa, ze
frontier of Sudan. Wady Haifa in ze days of ze khalifa was
built of Nile mud, and one of ze strongholds of ze Dervishes.
Ze Engleesh Lord Kig’ner, he make Wady Haifa hees
headquarter and make one railroad to Khartoum. After ze
war zis place he be rebuilt by Engleesh engineer, as to-
morrow you will see. After dinner ze Engleesh custom
officer he come on board to search for arms or ammunition,
for no sporting rifle be allowed in ze Sudan without ze
licence, which he cost fifty poun’ sterling. To-morrow I go
ashor wiz you la-dees and gen’lemens at ten o’clock. We
remain here, in Wady Haifa, till noon ze day after to-
morrow to take back ze European mail from Khartoum.
Monuments teeckets are not here wanted.”
There was the usual laugh at the mention of “monuments
tickets,” for every Nile traveller before leaving Cairo has to
obtain a permit from the Department of Antiquities to allow
him to visit the excavations. Hence every dragoman up and
down the Nile is ever reminding the traveller of his
“monument ticket,” and also that “galloping donkeys are not
allowed.”
“Monuments teeckets very much wanted; gallopin’ don-kees
not al-lowed,” is the parrot-like phrase with which each
dragoman concludes his daily address to his charges before
setting out upon an excursion.
Dinner over, many of the travellers landed to stroll through
the small town, half native, half European, which has lately
sprung up at the head of the Sudan railway.
As usual, Chester Dawson escorted Edna and went ashore
laughing merrily. Time was, and not so very long ago, when
Wady Haifa was an unsafe place for the European, even by
day. But under the benign British influence and control it is
to-day as safe as Brighton.
Hubert Waldron lit a cigar, and alone ascended the long
flight of steps which led from the landing-stage to the quay.
On the right lay the long, well-lit European railway station,
beyond, a clump of high palms looming dark against the
steely night sky. The white train, with its closed sun-
shutters, stood ready to start on its long journey south,
conveying the European mail over the desert with half a
dozen passengers to the capital of the Sudan.
He strolled upon the platform, and watched the bustle and
excitement among the natives as they entered the train
accompanied by many huge and unwieldy bundles, and
much gesticulation and shouting in Arabic. Attached to the
end of the train was a long car, through the open door of
which it could be seen that it contained living and sleeping
apartment.
At the door stood a sturdy, sunburnt Englishman in shirt
and trousers and wide-brimmed solar topee. With him
Waldron began to chat.
“Yes,” the English engineer replied, “I and my assistant are
just off into the desert for three weeks. The train drops us
off two hundred miles south, and there we shall remain at
work. The track is always requiring repair, and I assure you
we find the midday heat is sometimes simply terrible. The
only sign of civilisation that we see is when the express
passes up to Khartoum at daybreak, and down to Haifa at
midnight.”
“Terribly monotonous,” remarked the diplomat, used to the
gay society of the capitals.
“Oh, I don’t know,” replied the Englishman, with a rather
sad smile. “I gave up London five years ago—I had certain
reasons—and I came out here to recommence life and
forget. I don’t expect I shall ever go back.”
“Ah! Then London holds some painful memory for you—eh?”
remarked Waldron with sympathy.
“Yes,” he answered, with a hard, bitter look upon his face.
“But there,” he added quickly, “I suppose I shall get over it
—some day.”
“Why, of course you will,” replied the diplomat cheerfully.
“We all of us have our private troubles. Some men are not
so lucky as to be able to put everything behind them, and
go into self-imposed exile.”
“It is best, I assure you,” was the big, bronzed fellow’s
reply. Then noticing the signals he shouted into the inner
apartment: “We’re off, Clark. Want anything else?”
“No,” came the reply; “everything is right. I’ve just checked
it all.”
“We have to take food and water,” the engineer explained to
Waldron with a laugh. “Good night.”
“Good night—and good luck,” shouted Hubert, as the train
moved off, and a strong, bare arm waved him farewell.
Then after he had watched the red tail-light disappear over
the sandy waste he turned, and wondering what skeleton of
the past that exile held concealed in his cupboard, strode
along the river-bank beneath the belt of palms.
How many Englishmen abroad are self-exiles? How full of
bitterness is many a man’s heart in our far-off Colonies?
And how many good, sterling fellows are wearily dragging
out their monotonous lives, just because of “the woman”?
Does she remember? does she care? She probably still lives
her own life in her own merry circle—giddy and full of a
modern craving for constant excitement. She has, in most
cases, conveniently forgotten the man she wronged—
forgotten his existence, perhaps even his very name.
And how many men, too, have stood by and allowed their
lives to be wrecked for the purpose of preserving a woman’s
good name. But does the woman ever thank him? Alas! but
seldom—very seldom.
True, the follies of life are mostly the man’s. But the woman
does not always pay—as some would have us believe.
Waldron, puffing thoughtfully at his cigar, his thoughts far
away from the Nile—for he was recalling a certain evening
in Madrid when he had sat alone with Beatriz in her
beautiful flat in the Calle de Alcalâ—had passed through the
darkness of the palms, and out upon the path which still led
beside the wide river, towards the Second Cataract.
From the shadows of the opposite shore came the low
beating of a tom-tom and the Arab boatman’s chant—that
rather mournful chant one hears everywhere along the Nile
from the Nyanza to the sea, and which ends in “Al-lah-hey!
Al-lah-hey!” Allah! Always the call to Allah.
The sun—the same sun god that was worshipped at Abu
Simbel—had gone long ago, tired Nubia slept in peace, and
the stars that gazed down upon her fretted not the night
with thoughts of the creeds of men.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
testbankdeal.com

More Related Content

PDF
Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis S...
PDF
Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis S...
PPTX
Array 1D.................................pptx
PPTX
C_Arrays(3)bzxhgvxgxg.xhjvxugvxuxuxuxvxugvx.pptx
PPT
02 c++ Array Pointer
PPTX
Arrays_in_c++.pptx
PPTX
Lecture-5_Arrays.pptx FOR EDUCATIONAL PURPOSE
PPTX
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx
Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis S...
Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis S...
Array 1D.................................pptx
C_Arrays(3)bzxhgvxgxg.xhjvxugvxuxuxuxvxugvx.pptx
02 c++ Array Pointer
Arrays_in_c++.pptx
Lecture-5_Arrays.pptx FOR EDUCATIONAL PURPOSE
5 ARRAYS AND STRINGSjiuojhiooioiiouioi.pptx

Similar to Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis Solutions Manual (20)

PPTX
Lecture 5Arrays on c++ for Beginner.pptx
PPTX
Data structure array
PPTX
CSCI 238 Chapter 08 Arrays Textbook Slides
PPT
Computer Programming- Lecture 8
PPT
Fp201 unit4
PPT
Lecture#8 introduction to array with examples c++
PPTX
Data structure.pptx
PPTX
Arrays
PPT
Lecture#5-Arrays-oral patholohu hfFoP.ppt
DOCX
Array assignment
PPT
2621008 - C++ 4
PPTX
Chapter-Five.pptx
PPTX
Lecture 7
PPT
2DArrays.ppt
PDF
05_Arrays C plus Programming language22.pdf
PDF
Chapter12 array-single-dimension
PPTX
Arrays
PPTX
CPP05 - Arrays
PPT
CHAPTER-5.ppt
Lecture 5Arrays on c++ for Beginner.pptx
Data structure array
CSCI 238 Chapter 08 Arrays Textbook Slides
Computer Programming- Lecture 8
Fp201 unit4
Lecture#8 introduction to array with examples c++
Data structure.pptx
Arrays
Lecture#5-Arrays-oral patholohu hfFoP.ppt
Array assignment
2621008 - C++ 4
Chapter-Five.pptx
Lecture 7
2DArrays.ppt
05_Arrays C plus Programming language22.pdf
Chapter12 array-single-dimension
Arrays
CPP05 - Arrays
CHAPTER-5.ppt
Ad

Recently uploaded (20)

PPTX
Presentation on HIE in infants and its manifestations
PPTX
Institutional Correction lecture only . . .
PDF
Classroom Observation Tools for Teachers
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Structure & Organelles in detailed.
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
master seminar digital applications in india
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Presentation on HIE in infants and its manifestations
Institutional Correction lecture only . . .
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Cell Types and Its function , kingdom of life
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Structure & Organelles in detailed.
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
master seminar digital applications in india
102 student loan defaulters named and shamed – Is someone you know on the list?
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Ad

Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis Solutions Manual

  • 1. Visit https://testbankdeal.com to download the full version and explore more testbank or solutions manual Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis Solutions Manual _____ Click the link below to download _____ https://testbankdeal.com/product/starting-out-with-c-from- control-structures-to-objects-8th-edition-gaddis-solutions- manual/ Explore and download more testbank or solutions manual at testbankdeal.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. Starting Out with C++ from Control Structures to Objects 8th Edition Gaddis Test Bank https://testbankdeal.com/product/starting-out-with-c-from-control- structures-to-objects-8th-edition-gaddis-test-bank/ Starting Out With C++ From Control Structures To Objects 9th Edition Gaddis Solutions Manual https://testbankdeal.com/product/starting-out-with-c-from-control- structures-to-objects-9th-edition-gaddis-solutions-manual/ Starting Out With C++ From Control Structures To Objects 7th Edition Gaddis Solutions Manual https://testbankdeal.com/product/starting-out-with-c-from-control- structures-to-objects-7th-edition-gaddis-solutions-manual/ Computing Essentials 2019 27th Edition OLeary Test Bank https://testbankdeal.com/product/computing-essentials-2019-27th- edition-oleary-test-bank/
  • 3. Managerial Economics 3rd Edition Froeb Solutions Manual https://testbankdeal.com/product/managerial-economics-3rd-edition- froeb-solutions-manual/ Marketing 4th Edition Grewal Test Bank https://testbankdeal.com/product/marketing-4th-edition-grewal-test- bank/ Engineering Economy 15th Edition Sullivan Test Bank https://testbankdeal.com/product/engineering-economy-15th-edition- sullivan-test-bank/ Your College Experience Concise 12th Edition Gardner Solutions Manual https://testbankdeal.com/product/your-college-experience-concise-12th- edition-gardner-solutions-manual/ Estimating Construction Costs 6th Edition Peurifoy Solutions Manual https://testbankdeal.com/product/estimating-construction-costs-6th- edition-peurifoy-solutions-manual/
  • 4. Microeconomics 5th Edition Besanko Test Bank https://testbankdeal.com/product/microeconomics-5th-edition-besanko- test-bank/
  • 5. PURPOSE 1. To introduce and allow students to work with arrays 2. To introduce the typedef statement 3. To work with and manipulate multidimensional arrays PROCEDURE 1. Students should read the Pre-lab Reading Assignment before coming to lab. 2. Students should complete the Pre-lab Writing Assignment before coming to lab. 3. In the lab, students should complete labs assigned to them by the instructor. L E S S O N S E T 7 Arrays Contents Pre-requisites Approximate completion time Page number Check when done Pre-lab Reading Assignment 20 min. 114 Pre-lab Writing Assignment Pre-lab reading 10 min. 122 LESSON 7A Lab 7.1 Working with One- Basic understanding of 30 min. 123 Dimensional Arrays one-dimensional arrays Lab 7.2 Strings as Arrays of Basic understanding of 20 min. 126 Characters arrays of characters LESSON 7B Lab 7.3 Working with Two- Understanding of multi- 30 min. 129 Dimensional Arrays dimensional arrays Lab 7.4 Student Generated Code Basic understanding 30 min. 134 Assignments of arrays 113
  • 6. 114 LESSON SET 7 Arrays PRE-LAB READING ASSIGNMENT One-Dimensional Arrays So far we have talked about a variable as a single location in the computer’s memory. It is possible to have a collection of memory locations, all of which have the same data type, grouped together under one name. Such a collection is called an array. Like every variable, an array must be defined so that the com- puter can “reserve” the appropriate amount of memory. This amount is based upon the type of data to be stored and the number of locations, i.e., size of the array, each of which is given in the definition. Example: Given a list of ages (from a file or input from the keyboard), find and display the number of people for each age. The programmer does not know the ages to be read but needs a space for the total number of occurrences of each “legitimate age.” Assuming that ages 1, 2, . . . , 100 are possible, the following array definition can be used. const int TOTALYEARS = 100; int main() { int ageFrequency[TOTALYEARS]; //reserves memory for 100 ints : return 0; } Following the rules of variable definition, the data type (integer in this case) is given first, followed by the name of the array (ageFrequency), and then the total number of memory locations enclosed in brackets. The number of memory loca- tions must be an integer expression greater than zero and can be given either as a named constant (as shown in the above example) or as a literal constant (an actual number such as 100). Each element of an array, consisting of a particular memory location within the group, is accessed by giving the name of the array and a position with the array (subscript). In C++ the subscript, sometimes referred to as index, is enclosed in square brackets. The numbering of the subscripts always begins at 0 and ends with one less than the total number of locations. Thus the elements in the ageFrequency array defined above are referenced as ageFrequency[0] through ageFrequency[99]. 0 1 2 3 4 5 . . . . . . 97 98 99 If in our example we want ages from 1 to 100, the number of occurrences of age 4 will be placed in subscript 3 since it is the “fourth” location in the array. This odd way of numbering is often confusing to new programmers; however, it quickly becomes routine.1 1 Some students actually add one more location and then ignore location 0, letting 1 be the first location. In the above example such a process would use the following definition: int agefrequency[101]; and use only the subscripts 1 through 100. Our examples will use location 0. Your instructor will tell you which method to use.
  • 7. Pre-lab Reading Assignment 115 Array Initialization In our example, ageFrequency[0] keeps a count of how many 1s we read in, ageFrequency[1] keeps count of how many 2s we read in, etc. Thus, keeping track of how many people of a particular age exist in the data read in requires reading each age and then adding one to the location holding the count for that age. Of course it is important that all the counters start at 0. The following shows the initialization of all the elements of our sample array to 0. for (int pos = 0; pos < TOTALYEARS; pos++) // pos acts as the array subscript { ageFrequency[pos] = 0; } A simple for loop will process the entire array, adding one to the subscript each time through the loop. Notice that the subscript (pos) starts with 0. Why is the con- dition pos < TOTALYEARS used instead of pos <= TOTALYEARS? Remember that the last subscript is one less than the total number of elements in the array. Hence the subscripts of this array go from 0 to 99. Array Processing Arrays are generally processed inside loops so that the input/output processing of each element of the array can be performed with minimal statements. Our age frequency program first needs to read in the ages from a file or from the key- board. For each age read in, the “appropriate” element of the array (the one cor- responding to that age) needs to be incremented by one. The following examples show how this can be accomplished: from a file using infile as a logical name from a keyboard with –99 as sentinel data cout << "Please input an age from one" << "to 100. input -99 to stop" << endl; infile >> currentAge; cin >> currentAge; while (infile) while (currentAge != -99) { { ageFrequency[currentAge-1] = ageFrequency[currentAge-1] = ageFrequency[currentAge-1] + 1; ageFrequency[currentAge-1] + 1; infile >> currentAge; cout << "Please input an age from " << "one to 100. input -99 to stop" << endl; cin >> currentAge; } } The while(infile) statement means that while there is more data in the file infile, the loop will continue to process. To read from a file or from the keyboard we prime the read,2 which means the first value is read in before the test condition is checked to see if the loop 2 Priming the read for a while loop means having an input just before the loop condition (just before the while) and having another one as the last statement in the loop.
  • 8. 4 0 14 5 0 6 1 0 116 LESSON SET 7 Arrays should be executed. When we read an age, we increment the location in the array that keeps track of the amount of people in the corresponding age group. Since C++ array indices always start with 0, that location will be at the subscript one value less than the age we read in. 0 1 2 3 4 5 . . . . . . 98 99 1 year 2 years 3 years 4 years 5 years 6 years 99 years 100 years Each element of the array contains the number of people of a given age. The data shown here is from a random sample run. In writing the information stored in the array, we want to make sure that only those array elements that have values greater than 0 are output. The following code will do this. for (int ageCounter = 0; ageCounter < TOTALYEARS; ageCounter++) if (ageFrequency[ageCounter] > 0) cout << "The number of people " << ageCounter + 1 <<" years old is " << ageFrequency[ageCounter] << endl; The for loop goes from 0 to one less than TOTALYEARS (0 to 99). This will test every element of the array. If a given element has a value greater than 0, it will be output. What does outputting ageCounter + 1 do? It gives the age we are deal- ing with at any given time, while the value of ageFrequency[ageCounter] gives the number of people in that age group. The complete age frequency program will be given as one of the lab assign- ments in Lab 7.4. Arrays as Arguments Arrays can be passed as arguments (parameters) to functions. Although variables can be passed by value or reference, arrays are always passed by pointer, which is similar to pass by reference, since it is not efficient to make a “copy” of all ele- ments of the array. Pass by pointer is discussed further in Lesson Set 9. This means that arrays, like pass by reference parameters, can be altered by the call- ing function. However, they NEVER have the & symbol between the data type and name, as pass by reference parameters do. Sample Program 7.1 illustrates how arrays are passed as arguments to functions. Sample Program 7.1: // The grade average program // This program illustrates how one-dimensional arrays are used and how // they are passed as arguments to functions. It contains two functions. // The first function is called to allow the user to input a set of grades and // store them in an array. The second function is called to find the average // grade. #include <iostream> using namespace std;
  • 9. Pre-lab Reading Assignment 117 const int TOTALGRADES = 50; // TOTALGRADES is the maximum size of the array // function prototypes void getData(int array[], int& sizeOfArray); // the procedure that will read values into the array float findAverage(const int array[], int sizeOfArray); // the procedure that will find the average of values // stored in an array. The word const in front of the // data type of the array prevents the function from // altering the array int main() { int grades[TOTALGRADES]; // defines an array that holds up to 50 ints int numberOfGrades = 0; // the number of grades read in float average; // the average of all grades read in getData(grades, numberOfGrades); // getData is called to read the grades into // the array and store how many grades there // are in numberOfGrades average = findAverage(grades, numberOfGrades); cout << endl << "The average of the " << numberOfGrades << " grades read in is " << average << "." << endl << endl; return 0; } //*********************************************************************** // getData // // task: This function inputs and stores data in the grades array. // data in: none (the parameters contain no information needed by the // getData function) // data out: an array containing grades and the number of grades //*********************************************************************** void getData(int array[], int& sizeOfArray) { int pos = 0; // array index which starts at 0 int grade; // holds each individual grade read in cout << "Please input a grade or type -99 to stop: " << endl; cin >> grade; continues
  • 10. 118 LESSON SET 7 Arrays while (grade != -99) { array[pos] = grade; // store grade read in to next array location pos ++; // increment array index cout << "Please input a grade or type -99 to stop: " << endl; cin >> grade; } sizeOfArray = pos; // upon exiting the loop, pos holds the // number of grades read in, which is sent // back to the calling function } //**************************************************************************** // findAverage // // task: This function finds and returns the average of the values // // data in: the array containing grades and the array size // data returned: the average of the grades contained in that array //**************************************************************************** float findAverage (const int array[], int sizeOfArray) { int sum = 0; // holds the sum of all grades in the array for (int pos = 0; pos < sizeOfArray; pos++) { sum = sum + array[pos]; // add grade in array position pos to sum } return float(sum)/sizeOfArray; } Notice that a set of empty brackets [ ] follows the parameter of an array which indicates that the data type of this parameter is in fact an array. Notice also that no brackets appear in the call to the functions that receive the array. Since arrays in C++ are passed by pointer, which is similar to pass by reference, it allows the original array to be altered, even though no & is used to designate this. The getData function is thus able to store new values into the array. There may be times when we do not want the function to alter the values of the array. Inserting the word const before the data type on the formal parameter list pre- vents the function from altering the array even though it is passed by pointer. This is why in the preceding sample program the findAverage function and header had the word const in front of the data type of the array. float findAverage (const int array[], int sizeOfArray); // prototype float findAverage (const int array[], int sizeOfArray) // function header
  • 11. Pre-lab Reading Assignment 119 The variable numberOfGrades contains the number of elements in the array to be processed. In most cases not every element of the array is used, which means the size of the array given in its definition and the number of actual elements used are rarely the same. For that reason we often pass the actual number of ele- ments used in the array as a parameter to a procedure that uses the array. The variable numberOfGrades is explicitly passed by reference (by using &) to the getData function where its corresponding formal parameter is called sizeOfArray. Prototypes can be written without named parameters. Function headers must include named parameters. float findAverage (const int [], int); // prototype without named parameters The use of brackets in function prototypes and headings can be avoided by declaring a programmer defined data type. This is done in the global section with a typedef statement. Example: typedef int GradeType[50]; This declares a data type, called GradeType, that is an array containing 50 inte- ger memory locations. Since GradeType is a data type, it can be used in defining variables. The following defines grades as an integer array with 50 elements. GradeType grades; It has become a standard practice (although not a requirement) to use an upper- case letter to begin the name of a data type. It is also helpful to include the word “type” in the name to indicate that it is a data type and not a variable. Sample Program 7.2 shows the revised code (in bold) of Sample Program 7.1 using typedef. Sample Program 7.2: // Grade average program // This program illustrates how one-dimensional arrays are used and how // they are passed as arguments to functions. It contains two functions. // The first function is called to input a set of grades and store them // in an array. The second function is called to find the average grade. #include <iostream> using namespace std; const int TOTALGRADES = 50; // maximum size of the array // function prototypes typedef int GradeType[TOTALGRADES]; // declaration of an integer array data type // called GradeType continues
  • 12. 120 LESSON SET 7 Arrays void getData(GradeType array, int& sizeOfArray); // the procedure that will read values into the array float findAverage(const GradeType array, int sizeOfArray); // the procedure that will find the average of values // stored in an array. The word const in front of the // data type of the array prevents the function from // altering the array int main() { GradeType grades; // defines an array that holds up to 50 ints int numberOfGrades = 0; // the number of grades read in float average; // the average of all grades read in getData(grades, numberOfGrades);// getData is called to read the grades into // the array and store how many grades there // are in numberOfGrades average = findAverage(grades, numberOfGrades); cout << endl << "The average of the " << numberOfGrade << " grades read in is " << average << "." << endl << endl; return 0; } //*********************************************************************** // getData // // task: This function inputs and stores data in the grades array. // data in: none // data out: an array containing grades and the number of grades //*********************************************************************** void getData(GradeType array, int& sizeOfArray) { int pos = 0; // array index which starts at 0 int grade; // holds each individual grade read in cout << "Please input a grade or type -99 to stop: " << endl; cin >> grade; while (grade != -99) { array[pos] = grade; // store grade read in to next array location pos ++; // increment array index cout << "Please input a grade or type -99 to stop: " << endl; cin >> grade; }
  • 13. Pre-lab Reading Assignment 121 sizeOfArray = pos; // upon exiting the loop, pos holds the // number of grades read in, which is sent // back to the calling function } //**************************************************************************** // findAverage // // task: This function finds and returns the average of the values // // data in: the array containing grades and the array size // data returned: the average of the grades contained in that array //**************************************************************************** float findAverage (const GradeType array, int sizeOfArray) { int sum = 0; // holds the sum of all grades in the array for (int pos = 0; pos < sizeOfArray; pos++) { sum = sum + array[pos]; // add grade in array position pos to sum } return float(sum)/sizeOfArray; } This method of using typedef to eliminate brackets in function prototypes and headings is especially useful for multi-dimensional arrays such as those intro- duced in the next section. Two-Dimensional Arrays Data is often contained in a table of rows and columns that can be implement- ed with a two-dimensional array. Suppose we want to read data representing profits (in thousands) for a particular year and quarter. Quarter 1 Quarter 2 Quarter 3 Quarter 4 72 80 10 100 82 90 43 42 10 87 48 53 This can be done using a two-dimensional array. Example: const NO_OF_ROWS = 3; const NO_OF_COLS = 4; typedef float ProfitType[NO_OF_ROWS][NO_OF_COLS]; //declares a new data type //which is a 2 dimensional //array of floats continues
  • 14. 122 LESSON SET 7 Arrays int main() { ProfitType profit; // defines profit as a 2 dimensional array for (int row_pos = 0; row_pos < NO_OF_ROWS; row_pos++) for (int col_pos = 0; col_pos < NO_OF_COLS; col_pos++) { cout << "Please input a profit" << endl; cin >> profit[row_pos][col_pos]; } return 0; } A two dimensional array normally uses two loops (one nested inside the other) to read, process, or output data. How many times will the code above ask for a profit? It processes the inner loop NO_OF_ROWS * NO_OF_COLS times, which is 12 times in this case. Multi-Dimensional Arrays C++ arrays can have any number of dimensions (although more than three is rarely used). To input, process or output every item in an n-dimensional array, you need n nested loops. Arrays of Strings Any variable defined as char holds only one character. To hold more than one character in a single variable, that variable needs to be an array of characters. A string (a group of characters that usually form meaningful names or words) is really just an array of characters. A complete lesson on characters and strings is given in Lesson Set 10. PRE-LAB WRITING ASSIGNMENT Fill-in-the-Blank Questions 1. The first subscript of every array in C++ is and the last is less than the total number of locations in the array. 2. The amount of memory allocated to an array is based on the and the of locations or size of the array. 3. Array initialization and processing is usually done inside a . 4. The statement can be used to declare an array type and is often used for multidimensional array declarations so that when passing arrays as parameters, brackets do not have to be used. 5. Multi-dimensional arrays are usually processed within loops. 6. Arrays used as arguments are always passed by .
  • 15. Lesson 7A 123 7. In passing an array as a parameter to a function that processes it, it is often necessary to pass a parameter that holds the of used in the array. 8. A string is an array of . 9. Upon exiting a loop that reads values into an array, the variable used as a(n) to the array will contain the size of that array. 10. An n-dimensional array will be processed within nested loops when accessing all members of the array. LESSON 7A LAB 7.1 Working with One-Dimensional Arrays Retrieve program testscore.cpp from the Lab 7 folder. The code is as follows: // This program will read in a group of test scores (positive integers from 1 to 100) // from the keyboard and then calculate and output the average score // as well as the highest and lowest score. There will be a maximum of 100 scores. // PLACE YOUR NAME HERE #include <iostream> using namespace std; typedef int GradeType[100]; // declares a new data type: // an integer array of 100 elements float findAverage (const GradeType, int); // finds average of all grades int findHighest (const GradeType, int); // finds highest of all grades int findLowest (const GradeType, int); // finds lowest of all grades int main() { GradeType grades; // the array holding the grades. int numberOfGrades; // the number of grades read. int pos; // index to the array. float avgOfGrades; // contains the average of the grades. int highestGrade; // contains the highest grade. int lowestGrade; // contains the lowest grade. // Read in the values into the array pos = 0; cout << "Please input a grade from 1 to 100, (or -99 to stop)" << endl; continues
  • 16. 124 LESSON SET 7 Arrays cin >> grades[pos]; while (grades[pos] != -99) { // Fill in the code to read the grades } numberOfGrades = ; // Fill blank with appropriate identifier // call to the function to find average avgOfGrades = findAverage(grades, numberOfGrades); cout << endl << "The average of all the grades is " << avgOfGrades << endl; // Fill in the call to the function that calculates highest grade cout << endl << "The highest grade is " << highestGrade << endl; // Fill in the call to the function that calculates lowest grade // Fill in code to write the lowest to the screen return 0; } //******************************************************************************** // findAverage // // task: This function receives an array of integers and its size. // It finds and returns the average of the numbers in the array // data in: array of floating point numbers // data returned: average of the numbers in the array // //******************************************************************************** float findAverage (const GradeType array, int size) { float sum = 0; // holds the sum of all the numbers for (int pos = 0; pos < size; pos++) sum = sum + array[pos]; return (sum / size); //returns the average }
  • 17. Lesson 7A 125 //**************************************************************************** // findHighest // // task: This function receives an array of integers and its size. // It finds and returns the highest value of the numbers in the array // data in: array of floating point numbers // data returned: highest value of the numbers in the array // //**************************************************************************** int findHighest (const GradeType array, int size) { / Fill in the code for this function } //**************************************************************************** // findLowest // // task: This function receives an array of integers and its size. // It finds and returns the lowest value of the numbers in the array // data in: array of floating point numbers // data returned: lowest value of the numbers in the array // //**************************************************************************** int findLowest (const GradeType array, int size) { // Fill in the code for this function } Exercise 1: Complete this program as directed. Exercise 2: Run the program with the following data: 90 45 73 62 -99 and record the output here: Exercise 3: Modify your program from Exercise 1 so that it reads the informa- tion from the gradfile.txt file, reading until the end of file is encoun- tered. You will need to first retrieve this file from the Lab 7 folder and place it in the same folder as your C++ source code. Run the program.
  • 18. 126 LESSON SET 7 Arrays Lab 7.2 Strings as Arrays of Characters Retrieve program student.cpp from the Lab 7 folder. // This program will input an undetermined number of student names // and a number of grades for each student. The number of grades is // given by the user. The grades are stored in an array. // Two functions are called for each student. // One function will give the numeric average of their grades. // The other function will give a letter grade to that average. // Grades are assigned on a 10 point spread. // 90-100 A 80-89 B 70-79 C 60-69 D Below 60 F // PLACE YOUR NAME HERE #include <iostream> #include <iomanip> using namespace std; const int MAXGRADE = 25; // maximum number of grades per student const int MAXCHAR = 30; // maximum characters used in a name typedef char StringType30[MAXCHAR + 1];// character array data type for names // having 30 characters or less. typedef float GradeType[MAXGRADE]; // one dimensional integer array data type float findGradeAvg(GradeType, int); // finds grade average by taking array of // grades and number of grades as parameters char findLetterGrade(float); // finds letter grade from average given // to it as a parameter int main() { StringType30 firstname, lastname;// two arrays of characters defined int numOfGrades; // holds the number of grades GradeType grades; // grades defined as a one dimensional array float average; // holds the average of a student's grade char moreInput; // determines if there is more input cout << setprecision(2) << fixed << showpoint; // Input the number of grades for each student cout << "Please input the number of grades each student will receive." << endl << "This must be a number between 1 and " << MAXGRADE << " inclusive” << endl; cin >> numOfGrades;
  • 19. Lesson 7A 127 while (numOfGrades > MAXGRADE || numOfGrades < 1) { cout << "Please input the number of grades for each student." << endl << "This must be a number between 1 and " << MAXGRADE << " inclusiven"; cin >> numOfGrades; } // Input names and grades for each student cout << "Please input a y if you want to input more students" << " any other character will stop the input" << endl; cin >> moreInput; while (moreInput == 'y' || moreInput == 'Y') { cout << "Please input the first name of the student" << endl; cin >> firstname; cout << endl << "Please input the last name of the student" << endl; cin >> lastname; for (int count = 0; count < numOfGrades; count++) { cout << endl << "Please input a grade" << endl; // Fill in the input statement to place grade in the array } cout << firstname << " " << lastname << " has an average of "; // Fill in code to get and print average of student to screen // Fill in call to get and print letter grade of student to screen cout << endl << endl << endl; cout << "Please input a y if you want to input more students" << " any other character will stop the input" << endl; cin >> moreInput; } return 0; } continues
  • 20. 128 LESSON SET 7 Arrays //*********************************************************************** // findGradeAvg // // task: This function finds the average of the // numbers stored in an array. // // data in: an array of integer numbers // data returned: the average of all numbers in the array // //*********************************************************************** float findGradeAvg(GradeType array, int numGrades) { // Fill in the code for this function } //*********************************************************************** // findLetterGrade // // task: This function finds the letter grade for the number // passed to it by the calling function // // data in: a floating point number // data returned: the grade (based on a 10 point spread) based on the number // passed to the function // //*********************************************************************** char findLetterGrade(float numGrade) { // Fill in the code for this function } Exercise 1: Complete the program by filling in the code. (Areas in bold) Run the program with 3 grades per student using the sample data below. Mary Brown 100 90 90 George Smith 90 30 50 Dale Barnes 80 78 82 Sally Dolittle 70 65 80 Conrad Bailer 60 58 71 You should get the following results: Mary Brown has an average of 93.33 which gives the letter grade of A George Smith has an average of 56.67 which gives the letter grade of F Dale Barnes has an average of 80.00 which gives the letter grade of B Sally Dolittle has an average of 71.67 which gives the letter grade of C Conrad Bailer has an average of 63.00 which gives the letter grade of D
  • 21. Lesson 7B 129 LESSON 7B LAB 7.3 Working with Two-Dimensional Arrays Look at the following table containing prices of certain items: 12.78 23.78 45.67 12.67 7.83 4.89 5.99 56.84 13.67 34.84 16.71 50.89 These numbers can be read into a two-dimensional array. Retrieve price.cpp from the Lab 7 folder. The code is as follows: // This program will read in prices and store them into a two-dimensional array. // It will print those prices in a table form. // PLACE YOUR NAME HERE #include <iostream> #include <iomanip> using namespace std; const MAXROWS = 10; const MAXCOLS = 10; typedef float PriceType[MAXROWS][MAXCOLS]; // creates a new data type // of a 2D array of floats void getPrices(PriceType, int&, int&); // gets the prices into the array void printPrices(PriceType, int, int); // prints data as a table int main() { int rowsUsed; // holds the number of rows used int colsUsed; // holds the number of columns used PriceType priceTable; // a 2D array holding the prices getPrices(priceTable, rowsUsed, colsUsed); // calls getPrices to fill the array printPrices(priceTable, rowsUsed, colsUsed);// calls printPrices to display array return 0; } continues
  • 22. 130 LESSON SET 7 Arrays //******************************************************************************* // getPrices // // task: This procedure asks the user to input the number of rows and // columns. It then asks the user to input (rows * columns) number of // prices. The data is placed in the array. // data in: none // data out: an array filled with numbers and the number of rows // and columns used. // //******************************************************************************* void getPrices(PriceType table, int& numOfRows, int& numOfCols) { cout << "Please input the number of rows from 1 to "<< MAXROWS << endl; cin >> numOfRows; cout << "Please input the number of columns from 1 to "<< MAXCOLS << endl; cin >> numOfCols; for (int row = 0; row < numOfRows; row++) { for (int col = 0; col < numOfCols; col++) // Fill in the code to read and store the next value in the array } } //*************************************************************************** // printPrices // // task: This procedure prints the table of prices // data in: an array of floating point numbers and the number of rows // and columns used. // data out: none // //**************************************************************************** void printPrices(PriceType table, int numOfRows, int numOfCols) { cout << fixed << showpoint << setprecision(2); for (int row = 0; row < numOfRows; row++) { for (int col = 0; col < numOfCols; col++) // Fill in the code to print the table } }
  • 23. Lesson 7B 131 Exercise 1: Fill in the code to complete both functions getPrices and printPrices, then run the program with the following data: Exercise 2: Why does getPrices have the parameters numOfRows and numOfCols passed by reference whereas printPrices has those parameters passed by value? Exercise 3: The following code is a function that returns the highest price in the array. After studying it very carefully, place the function in the above program and have the program print out the highest value. float findHighestPrice(PriceType table, int numOfRows, int numOfCols) // This function returns the highest price in the array { float highestPrice; highestPrice = table[0][0]; // make first element the highest price for (int row = 0; row < numOfRows; row++) for (int col = 0; col < numOfCols; col++) if ( highestPrice < table[row][col] ) highestPrice = table[row][col]; return highestPrice; } continues
  • 24. 132 LESSON SET 7 Arrays NOTE: This is a value returning function. Be sure to include its prototype in the global section. Exercise 4: Create another value returning function that finds the lowest price in the array and have the program print that value. Exercise 5: After completing all the exercises above, run the program again with the values from Exercise 1 and record your results. Exercise 6: (Optional) Look at the following table that contains quarterly sales transactions for three years of a small company. Each of the quarterly transactions are integers (number of sales) and the year is also an integer. YEAR Quarter 1 Quarter 2 Quarter 3 Quarter 4 2000 72 80 60 100 2001 82 90 43 98 2002 64 78 58 84 We could use a two-dimensional array consisting of 3 rows and 5 columns. Even though there are only four quarters we need 5 columns (the first column holds the year). Retrieve quartsal.cpp from the Lab 7 folder. The code is as follows: // This program will read in the quarterly sales transactions for a given number // of years. It will print the year and transactions in a table format. // It will calculate year and quarter total transactions. // PLACE YOUR NAME HERE #include <iostream> #include <iomanip> using namespace std; const MAXYEAR = 10; const MAXCOL = 5; typedef int SalesType[MAXYEAR][MAXCOL]; // creates a new 2D integer data type void getSales(SalesType, int&); // places sales figures into the array void printSales(SalesType, int); // prints data as a table void printTableHeading(); // prints table heading int main() { int yearsUsed; // holds the number of years used SalesType sales; // 2D array holding // the sales transactions getSales(sales, yearsUsed); // calls getSales to put data in array
  • 25. Another Random Scribd Document with Unrelated Content
  • 26. He watched Lola hand a letter to the stranger, and wish him “Addio e buon viaggio!” Then he followed the bearded man down to the station, where, from a European official of whom he made a confidential inquiry, he learnt that the stranger had arrived in Assouan from Cairo only two hours before, bearing a return ticket to Europe by the mail route via Port Said and Brindisi. With curiosity he watched the Italian leave by the mail for Cairo ten minutes later, and then turned away and retraced his steps to the Cataract Hotel, plunged deep in thought. There was a mystery somewhere—a strange and very grave mystery. What could be that message of such extreme importance and secrecy that it could not be trusted to the post? Who was old Gigleux of whom Mademoiselle Duprez went in such fear? Was she really what she represented herself to be? No. He felt somehow assured that all was not as it should be. A mystery surrounded both uncle and niece, while the angular Miss Lambert remained as silent and impenetrable as the sphinx. Diplomat and man of the world as was Hubert Waldron—a man who had run the whole gamut of life in the gay centres of Europe—he was naturally suspicious, for the incident of that night seemed inexplicable. Something most secret and important must be in progress to necessitate the travelling of a special messenger from
  • 27. Europe far away into Upper Egypt, merely to deliver a letter and obtain a response. “Yes,” he murmured to himself as he passed through the portals of the hotel, which were thrown open to him by two statuesque Nubian servants, who bowed low as he passed. “Yes; there are some curious features about this affair. I will watch and discover the truth. Lola is in some secret and imminent peril. Of that I feel absolutely convinced.”
  • 28. Chapter Three. In the Holy of Holies. Five days later. Boulos, the faithful Egyptian dragoman, in his red fez and long caftan of yellow silk reaching to his heels, stood leaning over the bows of the small white steamer which was slowly wending its way around the many curves of the mighty river which lay between the Island of Philae and the Second Cataract at Wady Haifa, the gate of the Sudan. No railway runs through that wild desert of rock and sand, and the road to Khartoum lies by water over those sharp rocks and ever-shifting shoals where navigation is always dangerous, and progress only possible by daylight. Boulos, the dark, pleasant-faced man who is such an inveterate gossip, who knows much more of Egyptology than his parrot-talk to travellers, and who is popular with all those who go to and fro between Cairo and Khartoum, stood chatting in Arabic with the white-bearded, black-faced reis, or pilot. The latter, wearing a white turban, was wrapped in a red cloak though the sun was blazing. He squatted upon a piece of carpet in the bows, idly smoking a cigarette from dawn till sundown, and navigating the vessel by raising his right or left hand as signal to the man at the helm. A Nile steamer has no captain. The Nubian reis is supreme over the native crew, and being a man of vast experience of the river, knows by the appearance of the water where lie the ever-shifting sand-banks.
  • 29. “Oh yes,” remarked the reis in Arabic; “by Allah’s grace we shall anchor at Abu Simbel by sunset. It is now just past the noon,” added the bearded old man—who looked like a prophet—as he glanced upward at the burning sun. “And when shall we leave?” asked the dragoman. “At noon to-morrow—if Allah willeth it,” replied the old man. “To-night the crew will give a fantasia. Will you tell the passengers.” “If it be thy will,” responded Boulos, drawing at his excellent cigarette. “How farest thou this journey?” “Very well. The Prophet hath given me grace to sell several statuettes and scarabs. The little American hath bought my bronze of Isis.” “I congratulate thee, O wise one among the infidels,” laughed the old man, raising his left hand to alter the course of the vessel. “Thy bronze hath lain for many moons —eh?” “Since the last Ramadan. And now, with Allah’s help, I have sold it to the American for a thousand piastres.” Old Melek the reis grunted, and thoughtfully rolled another cigarette, which he handed unstuck to his friend, the sign of Arab courtesy. Boulos ran his tongue along it, and raising his hand to his fez in thanks, lit it with great gusto, glancing up to the deck where his charges were lolling beneath the awning. Lola, in white, and wearing her sun-helmet, leaned over the rail and called in her broken English:
  • 30. “Boulos, when do we arrive at Abu Simbel?” “At ze sunset, mees,” was the dragoman’s smiling reply. “To-morrow morning, at haf-pas tree we land, and we watch ze sun rise from inside ze gr-reat Tem-pel of Rameses.” Then raising his voice, so that all could hear, as is the habit of dragomans: “Ze gr-reat Tem-pel is cut in ze rock and made by Rameses to hees gr-reat gawd, Ra, gawd of ze sun. In ze front are fo-our colossi—gr-reat carved statues of Rameses seated. Zees, la-dees and gen’lemens, you will be able to see first as we come round ze bend of ze Nile about seex o’clock. To-morrow morning we land at haf-pas tree, and ze sight is one of ze grandest in all our Egypt.” “Half-past three!” echoed Chester Dawson, who was sitting in a deck-chair at Edna’s side. “I shall still be in my berth, I hope. No Temple of Rameses would get me up before sunrise.” “Say, you’re real lazy,” declared the buxom American girl. “I’ll be right there—you bet.” “But is the old ruin worth it? We’ve seen the wonderful works of Rameses all up the Nile.” “Waal—is it worth coming to Egypt at all?” she asked in her native drawl. “Guess it is—better than Eu-rope—even if you’re fed up by it.” “Oh, I don’t know. This beastly heat makes me sick,” and he gave a vigorous stroke with his horsehair fly-whisk with which each traveller was provided. Beelzebub assuredly lived in Egypt, for was he not the god of flies. Everything has a god in Egypt. Boulos had resumed his comfortable chat with Melek, the reis. His thousand piastre deal of that morning had fully
  • 31. satisfied him. Not that he ever overcharged the travellers for any antiques which he sold them. As everyone on the Nile knows—from Cairo to far Khartoum—Boulos the laughing, easy-going though gorgeously attired dragoman, is a scrupulously honest dealer. He is a friend of the greatest Egyptologists in the world and, unlike the common run of dragomans, has studied Egyptian history, and possesses quite a remarkable knowledge of hieroglyphics. Many a well-known European professor has sat at the knee of Boulos, and many an antique is now in one or other of the European national collections which originally passed through the hands of the ever-faithful Boulos. Waldron was sipping an innocuous drink composed of Evian water with a lime squeezed into it, and chatting in French with old Jules Gigleux, passing one of those usual mornings of laziness, away from the worries of letters and newspapers, which are so delightful up the Nile. Beneath the wide awning the soft, hot breeze pleasantly fanned them, while away on the banks rose the feathery palms on the tiny green strip of cultivated mud, sometimes only a few feet in width, and then the desert—that great glaring waste of brown sand—stretching away to the horizon where the sky shone like burnished copper. Mademoiselle, as full of mischief as ever, was the very life and soul of that smart party of moneyed folk which included two English peers, three American millionaires, an Austrian banker, a wealthy Russian prince, and two Members of Parliament who had paired. It had been whispered that she was daughter of Duprez, the millionaire sugar-refiner of Lyons; and, as everyone knows, the sugar of the Maison Duprez is used in nearly every household throughout France.
  • 32. Yet Waldron had heard quite a different story from her own lips while they had been seated together on deck the previous evening drinking coffee. “Ah?” she had sighed, “if I were only wealthy like the several other girls of this party, it would be different. Perhaps I could break away from uncle, and remain independent. But, alas! I cannot. I owe everything to him—I am dependent upon him for all I have.” This surprised Hubert considerably. Hitherto he had believed her to be the daughter of a wealthy man, because Miss Lambert showed her such marked deference. But such apparently was not the fact. Indeed she had declared later on to Waldron that she was very poor, and to her eccentric old uncle she was indebted for everything she received. Hers was a curious, complex character. Sometimes she would sit and chat and flirt violently with him—for by her woman’s intuition she knew full well that he admired her greatly—while at others she would scarcely utter a word to him. Hubert Waldron detested old Gigleux. Even though he sat chatting and laughing with him that morning, he held him in supreme contempt for his constant espionage upon his niece. The old fellow seemed ubiquitous. He turned up in every corner of the steamer, always feigning to take no notice of his niece’s constant companionship with the diplomat, and yet his sharp, shrewd eyes took in everything. On more than one occasion the Englishman was upon the point of demanding outright why that irritating observation was so constantly kept, nevertheless with a diplomat’s discretion, he realised that a judicious silence was best.
  • 33. That long, blazing day passed slowly, till at last the sun sank westward over the desert in a flame of green and gold. Then the thirty or so passengers stood upon the deck waiting in patience till, suddenly rounding the sharp bend of the river, they saw upon the right—carved in the high, sandstone cliff—the greatest and most wonderful sight in all Nubia. Lola was at the moment leaning over the rail, while Waldron stood idly smoking at her side. “See!” he cried suddenly. “Over there! Those four colossal seated figures guarding the entrance of the temple which faces the sunrise. That is Abu Simbel.” “How perfectly marvellous!” gasped the girl, astounded at the wonderful monument of Rameses the Great. “The temple is hewn in the solid rock—a temple about the size of Westminster Abbey in London. In the Holy of holies are four more seated figures in the darkness, and to- morrow as we stand in there at dawn, the sun, as it rises, will shine in at the temple door and gradually light up the faces of those images, until they glow and seem to become living beings—surely the most impressive sight of all the wonders of Egypt.” “I am longing to see it,” replied the girl, her eyes fixed in fascination at the far-off colossi seated there gazing with such calm, contented expression over the Nile waters, now blood-red in the still and gorgeous desert sunset. On the arid banks there was no sign of life, or even of vegetation. All was desert, rock, sand, and desolation. Where was the great, palpitating civilisation which had existed there in the days of Rameses, the cultured world which worshipped the great god, Ra, in that most wonderful
  • 34. of all temples? Gone, every trace save the place where the sun god was worshipped, swept out of existence, effaced, and forgotten. Over the vessel a great grey vulture hovered with slowly flapping wings. Then from the bows came a low chant, and the passengers craning their necks below, saw that the black-faced crew had turned towards Mecca and sunk upon their knees, including even the gorgeous Boulos himself, and with many genuflexions were adoring Allah. “Allah is great. Allah is merciful. He is the One,” they cried in their low, musical Arabic. “There is no god but Allah!” The sun sank and twilight came swiftly, as it does in the glowing, mystic East. And the white-bearded reis, his prayers finished, pushed on the steamer more quickly so as to anchor opposite Abu Simbel before darkness fell. The excitement among the passengers grew intense, for, on the morrow, ere the first pink of the dawn, the travellers were to stand within that rock-hewn temple, the most wonderful of all the works of the Pharaohs. The evening proved a merry one, for after dinner, with the vessel anchored in mid-stream—to obviate thieves— opposite the great temple, the Nubian crew gave a fantasia, or native song and dance, for the benefit of the travellers. On each trip from Shellal to Wady Haifa this was usual, for European travellers like to hear the weird native music, and the crooning desert songs in which Allah is praised so incessantly. Besides, a collection is made afterwards, and the sturdy, hard-working crew are benefited by many piastres. On the lower deck, beneath the brilliant stars the black- faced toilers of the Nile beat their tom-toms vigorously and
  • 35. chanted weirdly while the passengers stood leaning over, watching and applauding. The crew squatted in a circle, and one after the other sprang up and performed a wild, mad dance while their companions kept time by clapping their hands or strumming upon their big earthenware tom-toms. Then at eleven, the hour when the dynamos cease their humming and the electric light goes out, the concert ended with all the crew—headed by the venerable, white-bearded old pilot—standing up, salaaming and crying in their broken English: “Gud nites, la-dees and gen’lemens. Gud nites?” It was just before three on the following morning when the huge gong, carried around by an Arab servant, aroused everyone, and very soon from most of the cabins there turned out sleepy travellers who found the black giant Hassan ready with his little cups of delicious black coffee. Boulos was there, already gorgeous in a pale green silk robe, while the steamer had half an hour before moved up to the landing-place. “La-dees and gen’lemens!” cried the dragoman in his loud, drawling tone, “we no-ow go to see ze gree-at tem-pel of ze gawd, Ra—gawd of ze sun—ze tem-pel of ze sun-rise and ze greatest monument in all our Eg-eept. We shall start in fif mineets. In fif mineets, la-dees. Monuments tick-eets ve-ry much wanted. No gallopin’ donkeys in Abu Simbel!” Whereat there was a laugh. Then the under-dragoman, a person in a less gorgeous attire, proceeded to make up a parcel of candles, matches, and magnesium wire, and presently the travellers, all of whom had hastily dressed, followed their guide on shore,
  • 36. and over the tiny strip of cultivated mud until they came to the broad stone steps which led from the Nile bank to the square doorway of the temple. Here a number of candles were lit by the under-dragoman; and Waldron, taking one, escorted Lola and Miss Lambert. Within, they found a huge, echoing temple with high columns marvellously carved and covered by hieroglyphics and sculptured pictures. Through one huge chamber after another they passed, the vaulted roof so high that the light of their candles did not reach to it. Only could it be seen when the magnesium wire was burned, and then the little knot of travellers stood aghast in wonder at its stupendous proportions. At last they stood in the Holy of holies—a small, square chamber at the extreme end. In the centre stood the altar for the living sacrifices, the narrow groves in the stones telling plainly their use—the draining off of the blood. All was darkness. Only Boulos spoke, his drawling, parrot- like voice explaining many intensely interesting facts concerning that spot where Rameses the Great worshipped the sun god. Then there was a dead silence. Not one of that gay, chattering company dared to speak, so impressive and awe- inspiring was it all. Suddenly, from out of the darkness they saw before them slowly, yet distinctly, four huge figures seated, their hands lying upon their knees, gradually come into being as the sun’s faint pink rays, entering by the door, struck upon their
  • 37. stone faces, infusing life into their sphinx-like countenances until they glowed and seemed almost to speak. Expressions of amazement broke from everyone’s lips. “Marvellous!” declared Lola in an awed whisper. “Truly they seem really to live. It is astounding.” “Yes,” answered Waldron. “And thus they have lived each morning in the one brief hour of the sunrise through all the ages. From Rameses to Cleopatra each king and queen of Egypt has stood upon this spot and worshipped their great gods, Ra and the all-merciful Osiris. Such a sight as this surely dwarfs our present civilisation, and should bring us nearer to thoughts of our own Christian God—the Almighty.”
  • 38. Chapter Four. Contains a Bitter Truth. When Hubert returned on board the Arabia and entered his deck-cabin, one of a long row of small cubicles, he started back in surprise, for Gigleux was there. The Frenchman was confused at his sudden discovery, but only for a second. Then, with his calm, pleasant smile, he said in French: “Ah, m’sieur, a thousand pardons! I was looking for the book I lent you the other day—that book of Maspero’s. I want to refer to it.” Waldron felt at once that the excuse was a lame one. “I left it in the fumoir last night, I believe.” “Ah! Then I will go and get it,” replied the white-haired old fellow fussily. “But I hope,” he added, “that m’sieur will grant pardon for this unwarrantable intrusion. I did not go to the temple. It was a trifle too early for me.” “You missed a great treat,” replied the Englishman bluntly, tossing his soft felt hat upon his narrow little bed. “Mademoiselle will tell you all about it.” “You took her under your charge—as usual, eh?” sniffed the old fellow. “Oh, yes. I escorted both her and Miss Lambert,” was the diplomat’s reply. “But look here, M’sieur Gigleux,” he went on, “you seem to have a distinct antipathy towards me. You
  • 39. seem to be averse to any courtesy I show towards your niece. Why is this? Tell me.” The old man’s eyes opened widely, and he struck an attitude. “Mais non, m’sieur!” he declared quickly. “You quite misunderstand me. I am old—and perhaps I may be a little eccentric. Lola says that I am.” “But is that any reason why I should not behave with politeness to mam’zelle?” The old man with the closely cropped white hair paused for a few seconds. That direct question nonplussed him. He drew a long breath, and as he did so the expression upon his mobile face seemed to alter. In the silence Hubert Waldron was leaning against the edge of the little mosquito-curtained bed, while the Frenchman stood in the narrow doorway, for, in that little cabin, there was only sufficient room for one person to move about comfortably. “Yes,” responded the girl’s uncle. “Now that you ask me this very direct question I reply quite frankly that there is a reason—a very strong and potent reason why you, a man occupying an official position in the British diplomacy should show no undue courtesy to Mademoiselle Lola.” “Why?” asked Hubert, much surprised. “For several reasons. Though, as I expect she has already explained to you, she is a penniless orphan, daughter of my sister, whose wealthy husband lost every sou in the failure of the banking firm of Chenier Frères of Marseilles. I have
  • 40. accepted the responsibility of her education and I have already planned out her future.” “A wealthy husband, I suppose,” remarked the Englishman in a hard voice. “M’sieur has guessed the truth.” “And she is aware of this?” “Quite,” was the old man’s calm reply. “Therefore you now know the reason why I am averse to your attentions.” “Well, at least you are frank,” declared the other with a laugh. “But I assure you, M’sieur Gigleux, that I have no matrimonial intentions whatsoever. I’m a confirmed bachelor.” Gigleux shook his head wisely. “When a girl of Lola’s bright and irresponsible disposition is thrown hourly into the society of a man such as yourself, my dear friend, there is danger—always a grave danger.” “And is she fond of this man whom you have designated as her husband?” “Nowadays girls marry for position—not for love,” he grunted. “In France, yes—but scarcely so in England,” Waldron retorted, his anger rising. “Well, m’sieur, you have asked me a question, and I have replied,” the Frenchman said. “I trust that this open conversation will make no difference to our friendship,
  • 41. though I shall take it as a personal favour if, in the future, you will not seek Lola’s society quite so much.” “As you wish, m’sieur,” replied the diplomat savagely. He hated the crafty, keen-eyed old fellow and took no pains now to conceal his antipathy. The blow which he had for the past fortnight expected had fallen. He intended at the earliest moment to seek Lola, and inquire further into the curious situation, for if the truth be told, he had really fallen deeply in love with her, even though she might be penniless and dependent upon the old man. When old Gigleux had passed along the deck he sat down upon the bed and lighting a cigarette, reflected. He was a younger son with only seven hundred a year in addition to his pay from the Foreign Office. Madrid was an expensive post. Indeed, what European capital is not expensive to the men whose duty it is to keep up the prestige of the British Empire abroad? Diplomacy, save for the “plums,” is an ill- paid profession, for entertaining is a constant drain upon one’s pocket, as every Foreign Office official, from the poverty-stricken Consul to the Ambassador, harassed by debt, can, alas! testify. Many an Ambassador to a foreign Court has been ruined by the constant drain of entertaining. Appearances and social entertainments are his very life, and if he cuts down his expenses Britain’s prestige must suffer, and at Downing Street they will quickly query the cause of his parsimony. So the old game goes on, and the truth is, that many a man of vast diplomatic experience and in a position of high responsibility is worse off in pocket than the average suburban tradesman.
  • 42. Hubert Waldron bit his lip. After all, he was a fool to allow himself to think of her. No diplomat should marry until he became appointed Minister, and a bachelor life was a pleasant one. Curious, he thought, that he, a man who had run the whole gamut of life in the capitals, and who had met so many pretty and fascinating women in that gay world which revolves about the Embassies, should become attracted by that merry little French girl, Lola Duprez. Breakfast over, the party went ashore again, now in linen clothes and sun-helmets, to wander about the temple till noon, when they were to leave for Wady Haifa. He saw Lola and Edna Eastham walking with Chester Dawson, so, following, he joined them and at last secured an opportunity of speaking with Lola alone. They were strolling slowly around the edge of the sandstone cliff, away from the colossal façade of the temple, and out of sight of the steamer, for the old Frenchman had fortunately still remained on board—the blazing heat being too much for him. “Lola,” her companion exclaimed, “I have spoken to your uncle quite openly this morning. I know that he hates me.” She turned quickly and looked straight at him with her wonderful dark eyes. “Well—?” she asked. “He has told me the truth,” Waldron went on seriously. “He has explained that the reason he objects to our companionship is because you are already betrothed.” “Betrothed?” she echoed, staring at him.
  • 43. “Yes. To whom? Tell me, mam’zelle,” he asked slowly. She made no response. Her eyes were downcast; her cheeks suddenly pale. They were standing beneath the shadow of an ancient wide-spreading tree which struggled for existence at the edge of the Nile flood. “He has said that I am betrothed—eh?” she asked, as though speaking to herself. “He has told me so. Your future husband has been already chosen,” he said in a low, mechanical tone. Her teeth were set, her sweet, refined countenance had grown even paler. “Yes,” she admitted at last, drawing a deep breath. “My past has been bright and happy, but, alas! before me there now only lies tragedy; and despair. Ah! if I were but my own mistress—if only I could escape this grip of evil which is ever upon me!” “Grip of evil! What do you mean?” he inquired eagerly. “Ah! you do not know—you can never tell!” she cried. “The evil hand of Jules Gigleux is ever upon me, a hard, iron, inexorable hand. Ah! M’sieur Waldron, you would, if you only knew the truth, pity a woman who is in the power of a man of that stamp—a man who has neither feeling, nor conscience, neither human kindness nor remorse.” “He’s a confounded brute—that I know. I feel sure of it,” her companion declared hastily. “But look here, mam’zelle, can’t I assist you? Can’t I help you out of this pitfall into which you seem to have fallen. Why should you be forced to marry this man whom your uncle has chosen—whoever he may be?”
  • 44. She shook her head mournfully, her lips quite white. “No,” she sighed. “I fear your efforts could have no avail. It is true that I am betrothed—pledged to a man whom I hate. But I know that I cannot escape. I must obey the decree which has gone forth. Few girls to-day marry for love, I fear —and true love, alas! seems ever to bring poverty in its wake.” “That’s the old sentimental way of looking at it,” he declared. “There’s many a rich marriage in which Cupid plays the principal part. I’ve known lots.” “In my case it cannot be,” the girl declared hopelessly. “My future has been planned for me, and admits of no alteration,” she went on. “To me, love—the true love of a woman towards a man—is forbidden. My only thought is to crush it completely from my heart and to meet my future husband as I would a dire misfortune.” “Not a very cheerful outlook, I fear.” “No, my future can, alas! be only one of tragedy, M’sieur Waldron, so the less we discuss it the better. It is, I assure you, a very painful subject,” and again she sighed heavily, and he saw hot tears welling in those splendid eyes which he always admired so profoundly. Her face was full of black tragedy, and as Waldron gazed upon it his heart went out in deepest sympathy towards her. “But surely this uncle of yours is not such an absolute brute as to compel you to wed against your will!” he cried. “Not he alone compels me. There are other interests,” was her slow reply, her voice thick with suppressed emotion. “I
  • 45. am bound, fettered, hand and foot. Ah! you do not know!” she cried. “Cannot I assist you to break these fetters?” he asked, bending to her earnestly. “I see that you are suffering, and if I can do anything to serve your interests I assure you, mademoiselle, I will.” “I feel certain of that,” was her answer. “Already you have been very good and patient with me. I know I have often sorely tried your temper. But you must forgive me. It is my nature, I fear, to be mischievous and irresponsible.” At that instant the recollection of the night in Assouan crossed Waldron’s mind—of that mysterious messenger who had come post-haste from Europe, and had as mysteriously returned. He had never mentioned the affair, for had he done so she would have known that he had spied upon her. Therefore he had remained silent. They stood together beneath the shade of that spreading tree with the heat of the desert sand reflected into their faces—stood in silence, neither speaking. At last he said: “And may I not know the identity of the man who is marked out to be your husband?” “No; that is a secret, M’sieur Waldron, which even you must not know. It is my affair, and mine alone,” she replied in a low tone. “I’m naturally most curious,” he declared, “for if I can assist you to extricate yourself from this impasse I will.”
  • 46. “I thank you most sincerely,” was her quick response, as she looked up at him with her soft, big eyes. “If at any time I require your assistance I will certainly count upon you. But, alas! I fear that no effort on your part could avail me. There are reasons—reasons beyond my control—which make it imperative that I should marry the man marked out for me.” “It’s a shame—a downright sin!” he cried fiercely. “No, mademoiselle,” and he grasped her small hand before she could withdraw it; “I will not allow you to sacrifice yourself to your uncle’s whim.” She shook her head slowly, answering: “It is, alas! not within your power to prevent it! The matter has already been arranged.” “Then you are actually betrothed?” “Yes,” she replied in a hoarse voice. “To a man I hate.” “Then you must let me act on your behalf. I must—I will?” “No. You can do nothing to help me. As I have already explained, my life in future can only be one of tragedy—just as yours may be, I fear,” she added in a slow, distinct voice. “I hardly follow you,” he exclaimed, looking at her much puzzled. She smiled sadly, turning her big eyes upon his. “Probably not,” she said. “But does not half Madrid know the tragedy of your love for the dancer, Beatriz Rojas de Ruata, the beautiful woman whose misfortune it is to have a husband in the person of a drunken cab-driver.”
  • 47. “What!” he gasped, starting and staring at her in amazement. “Then you know Madrid?” “Yes, I have been in Madrid,” was her answer. “And I have heard in the salons of your mad infatuation for the beautiful opera-dancer. It is common gossip, and most people sigh and sympathise with you, for it is known, too, that Hubert Waldron, of the British Embassy, is the soul of honour—and that such love as his can only bring tragedy in its train.” “You never told me that you had been in Madrid!” “Because you have never asked me,” was her calm reply. “But I know much more concerning you, M’sieur Waldron, than you believe,” she said with a mysterious smile. Then, her eyes glowing, she added: “I have heard you discussed in Madrid, in Barcelona, and in San Sebastian, and I know that your love for the beautiful Beatriz Rojas de Ruata is just as fraught with tragedy as the inexorable decree which may, ere long, bind me as wife to the one man whom I hate and detest most in all the world!”
  • 48. Chapter Five. A Surprise. Egypt is the strangest land, the weirdest land, the saddest land in all the world. It is a land of memories, of monuments, and of mysticism; a land of dreams that never come true, a land of mystery, a great cemetery stretching from ancient Ethiopia away to the sea, a great grave hundreds of miles long in which is buried perhaps as many millions of human beings as exist upon our earth to-day. Against the low-lying shore of the great Nile valley have beaten many of the greatest waves of human history. It is the grave of a hundred dead Egypts, old and forgotten Egypts, that existed and possessed kings and priests and rules and creeds, and died and were succeeded by newer Egypts that now, too, are dead, that in their time believed they reared permanently above the ruins of the past. The small white steamer lay moored in the evening light at the long stone quay before the sun-baked town of Wady Haifa, close to the modern European railway terminus of the long desert-line to Khartoum. On board, dinner was in progress in the cramped little saloon, no larger than that of a good-sized yacht, and everyone was in high spirits, for the Second Cataract, a thousand miles from Cairo, had at last been reached. Amid the cosmopolitan chatter in French, English, Italian and German, Boulos, arrayed in pale pink silk—for the dragoman is ever a chameleon in the colour of his perfumed
  • 49. robes—made his appearance and clapped his hands as signal for silence. “La-dees and gen’lemens,” he cried in his long-drawn-out Arab intonation, “we haf arrived now in Wady Haifa, ze frontier of Sudan. Wady Haifa in ze days of ze khalifa was built of Nile mud, and one of ze strongholds of ze Dervishes. Ze Engleesh Lord Kig’ner, he make Wady Haifa hees headquarter and make one railroad to Khartoum. After ze war zis place he be rebuilt by Engleesh engineer, as to- morrow you will see. After dinner ze Engleesh custom officer he come on board to search for arms or ammunition, for no sporting rifle be allowed in ze Sudan without ze licence, which he cost fifty poun’ sterling. To-morrow I go ashor wiz you la-dees and gen’lemens at ten o’clock. We remain here, in Wady Haifa, till noon ze day after to- morrow to take back ze European mail from Khartoum. Monuments teeckets are not here wanted.” There was the usual laugh at the mention of “monuments tickets,” for every Nile traveller before leaving Cairo has to obtain a permit from the Department of Antiquities to allow him to visit the excavations. Hence every dragoman up and down the Nile is ever reminding the traveller of his “monument ticket,” and also that “galloping donkeys are not allowed.” “Monuments teeckets very much wanted; gallopin’ don-kees not al-lowed,” is the parrot-like phrase with which each dragoman concludes his daily address to his charges before setting out upon an excursion. Dinner over, many of the travellers landed to stroll through the small town, half native, half European, which has lately sprung up at the head of the Sudan railway.
  • 50. As usual, Chester Dawson escorted Edna and went ashore laughing merrily. Time was, and not so very long ago, when Wady Haifa was an unsafe place for the European, even by day. But under the benign British influence and control it is to-day as safe as Brighton. Hubert Waldron lit a cigar, and alone ascended the long flight of steps which led from the landing-stage to the quay. On the right lay the long, well-lit European railway station, beyond, a clump of high palms looming dark against the steely night sky. The white train, with its closed sun- shutters, stood ready to start on its long journey south, conveying the European mail over the desert with half a dozen passengers to the capital of the Sudan. He strolled upon the platform, and watched the bustle and excitement among the natives as they entered the train accompanied by many huge and unwieldy bundles, and much gesticulation and shouting in Arabic. Attached to the end of the train was a long car, through the open door of which it could be seen that it contained living and sleeping apartment. At the door stood a sturdy, sunburnt Englishman in shirt and trousers and wide-brimmed solar topee. With him Waldron began to chat. “Yes,” the English engineer replied, “I and my assistant are just off into the desert for three weeks. The train drops us off two hundred miles south, and there we shall remain at work. The track is always requiring repair, and I assure you we find the midday heat is sometimes simply terrible. The only sign of civilisation that we see is when the express passes up to Khartoum at daybreak, and down to Haifa at midnight.”
  • 51. “Terribly monotonous,” remarked the diplomat, used to the gay society of the capitals. “Oh, I don’t know,” replied the Englishman, with a rather sad smile. “I gave up London five years ago—I had certain reasons—and I came out here to recommence life and forget. I don’t expect I shall ever go back.” “Ah! Then London holds some painful memory for you—eh?” remarked Waldron with sympathy. “Yes,” he answered, with a hard, bitter look upon his face. “But there,” he added quickly, “I suppose I shall get over it —some day.” “Why, of course you will,” replied the diplomat cheerfully. “We all of us have our private troubles. Some men are not so lucky as to be able to put everything behind them, and go into self-imposed exile.” “It is best, I assure you,” was the big, bronzed fellow’s reply. Then noticing the signals he shouted into the inner apartment: “We’re off, Clark. Want anything else?” “No,” came the reply; “everything is right. I’ve just checked it all.” “We have to take food and water,” the engineer explained to Waldron with a laugh. “Good night.” “Good night—and good luck,” shouted Hubert, as the train moved off, and a strong, bare arm waved him farewell. Then after he had watched the red tail-light disappear over the sandy waste he turned, and wondering what skeleton of the past that exile held concealed in his cupboard, strode along the river-bank beneath the belt of palms.
  • 52. How many Englishmen abroad are self-exiles? How full of bitterness is many a man’s heart in our far-off Colonies? And how many good, sterling fellows are wearily dragging out their monotonous lives, just because of “the woman”? Does she remember? does she care? She probably still lives her own life in her own merry circle—giddy and full of a modern craving for constant excitement. She has, in most cases, conveniently forgotten the man she wronged— forgotten his existence, perhaps even his very name. And how many men, too, have stood by and allowed their lives to be wrecked for the purpose of preserving a woman’s good name. But does the woman ever thank him? Alas! but seldom—very seldom. True, the follies of life are mostly the man’s. But the woman does not always pay—as some would have us believe. Waldron, puffing thoughtfully at his cigar, his thoughts far away from the Nile—for he was recalling a certain evening in Madrid when he had sat alone with Beatriz in her beautiful flat in the Calle de Alcalâ—had passed through the darkness of the palms, and out upon the path which still led beside the wide river, towards the Second Cataract. From the shadows of the opposite shore came the low beating of a tom-tom and the Arab boatman’s chant—that rather mournful chant one hears everywhere along the Nile from the Nyanza to the sea, and which ends in “Al-lah-hey! Al-lah-hey!” Allah! Always the call to Allah. The sun—the same sun god that was worshipped at Abu Simbel—had gone long ago, tired Nubia slept in peace, and the stars that gazed down upon her fretted not the night with thoughts of the creeds of men.
  • 53. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! testbankdeal.com