Question: PROMPTS: Code the bold from the prompts below in the printf statements that capture data into your program. Once again, the prompts tell you your

PROMPTS: Code the bold from the prompts below in the printf statements that capture data into your program. Once again, the prompts tell you your input variables.

Welcome Message: Prints before prompt for customer name.

YEE-TRADE, INC. - The Wild West of Electronic Trading Welcome to Yee-Trade's stock purchase calculator. 1st Prompt: What is your name?

2nd Prompt: Beginning with this prompt, the majority of the code will be nested in the do-while mentioned in 2c above.

Enter your log-in:

3rd Prompt: If the entries from the 2nd and 3rd prompts match the real log-in and password proceed to the 4th prompt else print the error message(s).

Enter your password:

Error Message When Log-In & Password Incorrect: One of these error messages will be displayed every time the log-in or password is incorrect. The 9 represents the number of attempts left out of two (2). Youll accommodate in the code for the possibility of more than 2 attempts.

Invalid log-in or password! 9 attempts left. Use when >= 2 attempts left

Invalid log-in or password! 9 attempt left. Use when 1 attempt left

Error Message When No More Attempts Left: This error message will be displayed when there are no more attempts left, and the program will terminate. This is NOT a forced exit. The code should automatically sequence to the exit statement at the end of main().

No more attempts left! Contact technical support at 1-800-111-2222.

4th Prompt: This prompt will display after the customer enters the correct log-in and password within the allotted 2 attempts. The value captured from this prompt is the loop-control variable for the sentinel-while loop mentioned in 1a of the Program Instructions section above.

Do you want to calculate your stock purchases? Enter 'Y' or 'N' to exit:

If the answer is anything other than Y, the while loop is by-passed and this message is displayed:

Thank you for using Yee-Trade's stock purchase calculator!

5th Prompt: Prompts 5 through 9 will be in a sentinel-controlled while loop.

How many shares did you purchase?

6th Prompt:

What is the price per share?

7th Prompt: If the answer to this prompt is 'Y' add a 5.95 online trading fee to the stock cost then go to the 9th prompt, else go to the 8th prompt. Also, refer to 1c for additional calculation instructions.

Is this an online trade? Enter 'Y' or 'N':

8th Prompt: This prompt will display only when the answer to the 7th prompt is 'N'. If the answer to this prompt is 'Y', calculate the commission by assessing a 2% brokerage fee on the stock cost then go to the 9th prompt, else proceed to the error message.

Is this a broker assisted trade? Enter 'Y' or 'N':

Error Message When Trade is Neither Online or Broker Assisted: If the answer is 'N', print this error message then proceed to the 9th prompt.

"INVALID TRADE TYPE!"

9th Prompt: If the answer is 'Y' then you'll go back to the 5th prompt. This is the same loop-control variable in prompt 4.

Enter 'Y' for another stock purchase or 'N' to see the cost of your stock purchases:

If the answer is anything other than Y, the while loop is exited, the final output is displayed along with this message:

Thank you for using Yee-Trade's stock purchase calculator!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!