Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program that upon starting asks the user for their name, then displays a welcome message and prompts the user to choose one

Write a C program that upon starting asks the user for their name, then displays a welcome message and prompts the user to choose one of 3 options: 1. to play a game called Guess The Number 2. to play a game called Hangman 3. to exit the program The output of this task is shown in Figure 1. Page 5 of 10 Figure 1 If the user enters 1, the program should run a function called startGuessTheNumberGame that just prints "Guess the Number has started." If the user enters 2, the program should run a function called startHangmanGame that just prints "Hangman has started." If the user chooses 3, the program should exit. If the user enters any other number, the program should display an error message "Invalid choice." As long as the user does not enter 3, the program should carry out the appropriate action and display the menu again. The program will only exit if the user enters 3.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago