Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assignment 6 This assignment only has 4 areas for you to add code. Look for the

ID: 3567945 • Letter: A

Question

Assignment 6
This assignment only has 4 areas for you to add code. Look for the following highlighted comments in
the template for you to provide the requested commands. Completing these 4 areas will make this
code operational.
/* 1. Write a declaration for an ofstream object called outFile to
open the file entered by the user */
/* 2. Write code to check if the file was opened successfully, and terminate
if not */
/* 3. Write a declaration for an array of 10 const char *'s called
phoneLetters. Use an initializer list to assign each element of the array the
corresponding string of three letters. Use an empty string for 0 and 1 */
/* 4. Write a statement to close the output file */
Project 2 will involve more of the file operation commands.
Code Description:
Standard telephone keypads contain the digits 0 through 9. The numbers 2 through 9 each have three
letters associated with them, as is indicated by the following table:
Digit Letter
2 A B C
3 D E F
4 G H I
5 J K L
6 M N O
7 P R S
8 T U V
9 W X Y
Many people find it difficult to memorize phone numbers, so they use the correspondence between
digits and letters to develop seven-letter words that correspond to their phone numbers. For example,
a person whose telephone number is 378-6653 might use the correspondence indicated in the above
table to develop the seven letter word

Explanation / Answer

Write a declaration for an ofstream object called outFile to
open the file entered by the user */
/* 2. Write code to check if the file was opened successfully, and terminate
if not */
/* 3. Write a declaration for an array of 10 const char *'s called
phoneLetters. Use an initializer list to assign each element of the array the
corresponding string of three letters. Use an empty string for 0 and 1 */
/* 4. Write a statement to close the output file */
Project 2 will involve more of the file operation commands.
Code Description:
Standard telephone keypads contain the digits 0 through 9. The numbers 2 through 9 each have three
letters associated with them, as is indicated by the following table:
Digit Letter
2 A B C
3 D E F
4 G H I
5 J K L
6 M N O
7 P R S
8 T U V
9 W X Y
Many people find it difficult to memorize phone numbers, so they use the correspondence between
digits and letters to develop seven-letter words that correspond to their phone numbers. For example,
a person whose telephone number is 378-6653 might use the correspondence indicated in the above
table to develop the seven letter word