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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started