Teacher Name:Mr. Rung
Date of Lesson: January
Primary Focus
Answer questions 1 and 2 below.
Use the program below to answer # 3, 4 and 5.
#include
#include
int main ()
{
char c;
cout « "Please enter a character \n"; cin » c;
if (islower (c))
c = toupper(c);
if (isdigit(c))
cout « "The character entered is a number \n";
if (isalpha(c))
cout « "The character entered is a letter \n";
if (isupper (c))
c = tolower(c);
cout « c;
return 0;
}//MAIN
In the space below the following program,
write the output that will be written to the screen.
#include < iostream.h >
//PROTOTYPES
int Change-Values(int, int &);
//GLOBAL VARIABLES
char M-Initial = 'H'; //GLOBAL VARIABLE
int main()
{
int i=O, j=5, returned=O;
j++;
i++;
cout « "i = "«i«endl;
cout « "j = "«j«endl;
cout « "M-Initial = "«M-Initial«endl;
returned = Change-Values(i,j);
cout « "i = "«i«endl;
cout « "j = "«j«endl;
cout « "M-Initial = "«M-Initial«endl;
cout « "Returned value = "«returned«endl;
return 0;
}//MAIN
int Change-Values(int Value, int & Reference)
{
Reference = Reference + Value;
Value = Reference + Value;
M-Initial++;
return (Value * Reference);
}//CHANGE-VALUE