Question: Question1) Using C++, Splashkit and Visual studio code answer the question. Example- string read_string(string prompt) { string result; write(prompt); result = read_line(); return result; }

Question1) Using C++, Splashkit and Visual studio code answer the question.

Example-

string read_string(string prompt)

{

string result;

write(prompt);

result = read_line();

return result;

}

a)How would a read_double code portion be to make sure it checks if the user has entered a valid number before doing the conversion so that it does not crash when an invalid value is entered?

b) How would a read_double_range code portion be to read a number between minimum and maximum (inclusive) values? For example, read a double between 0.0 and 1.0.

c) How would a read_boolean function code portion be to ask the function "yes/no" type questions? The user should be able to type "yes" or "y" (for true) and "no" or "n" for false. (This should not be case sensitive, and should work if there are leading or trailing spaces)?

NO iostream code please.

please answer in the example formant

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!