In this exercise, you modify the program from TRY THIS Exercise 8. If necessary, create a new

Question:

In this exercise, you modify the program from TRY THIS Exercise 8. If necessary, create a new project named ModifyThis9 Project and save it in the Cpp8\Chap15 folder. Copy the instructions from the TryThis8.cpp file into a source file named ModifyThis9.cpp. Change the filename in the first comment. Also copy the instructions from the TryThis8 FormattedDate.h file into a header file named ModifyThis9 FormattedDate.h file. If necessary, change the filename in the first comment. Also change the filename in the #include directive. Modify the program so that it asks the user whether he or she wants to display the formatted date using either slashes (/) or hyphens (-). Save and then run the program. Test the program by entering 4 as the month, 9 as the day, 2017 as the year, and a - (hyphen) as the separator. The program displays 4-9-2017 on the computer screen. Run the program again. Enter 12 as the month, 21 as the day, 2016 as the year, and a / (slash) as the separator. The program displays 12/21/2016 on the computer screen. (Hint: The getFormattedDate method should receive a string that indicates whether the user wants slashes or hyphens in the date.)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: