Question: You always create a separate C++ file for each program you write in lab. 1. Write a C++ program that does the following: a.

You always create a separate C++ file for each program you write in lab. 1. Write a C++ program that does the

You always create a separate C++ file for each program you write in lab. 1. Write a C++ program that does the following: a. Create a C++ file with the name problem1.cpp. b. Prompt the user for an odd positive integer n, terminating the program if the user enters an invalid integer. c. Print an n x n grid displaying a line running from the top left corner to the bottom right corner with the following properties: i. ii. iii. Sample run of the program: Enter value for n: 7 + + + + * The top left half of the line using the character + The bottom right half of the line using the character x The middle line using the character * X 2. Write a C++ program that does the following: a. Create a C++ file with the name problem2.cpp. + b. Prompt the user for an odd positive integer n, terminating the program if the user enters an invalid integer. + X c. Print an n x n grid displaying a large letter X with the following properties: a. The left half of the X using the character + Sample run of the program: Enter value for n: 7 + X + X b. The right half of the X using the character x c. The middle line using the character * + x * X X X X

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Problem 1 Source Code includ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!