Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a. Write a line of code that asks the user what their favorite number is, that only accepts numeric input, and saves the answer in

a. Write a line of code that asks the user what their favorite number is, that only accepts numeric input, and saves the answer in variable D1.

b. Write a line of code that asks the user what their favorite color is, that only accepts string input, and saves the answer in variable D2.

c. Construct a 1x2 string matrix L1 where the string HYPE is the first element and the string EXHAUSTED is the second element.

d. Using the menu command, write a line of code that asks the user (via GUI) whether they are feeling "ENERGETIC" or "TIRED", and saves the selection in variable D3. You should be using L1 in your answer. e. Write a line of code that shows the variable D3 and its value, without using fprintf.

f. Display the option user picked in part (d). If the user picked ENERGETIC, you should print HYPE. If the user picked TIRED, you should print EXHAUSTED. You cannot use if or switch statements. Hint: Think about indexing, you should be using L1 in your answer.

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago