in c++ /** * Problem 1: Simple Selection * You and your date are trying to get a table at a * restaurant. The first input ("you") is the stylishness * of your clothes, in the range 0..10, and the second * ("date") is the stylishness of your date's clothes. * The result getting the table is encoded as "no", * "maybe", or "yes". If either of you is very stylish, * 8 or more, then the result is yes. With the exception * that if either of you has style of 2 or less, then * the result is no. Otherwise the result is maybe. * * - input of 5, 10 -> "yes" * - input of 5, 2 -> "no" * - input of 5, 5 -> "maybe" */ /** * Problem 2: Intermediate Selection/Logic * * Given 3 int values, a b c, set result to their sum. * However, if one of the values is the same as another * of the values, it does not count towards the sum. * * - input of 1, 2, 3 -> 6 * - input of 3, 2, 3 -> 2 * - input of 3, 3, 3 -> 0 */
in c++
/**
* Problem 1: Simple Selection
* You and your date are trying to get a table at a
* restaurant. The first input ("you") is the stylishness
* of your clothes, in the range 0..10, and the second
* ("date") is the stylishness of your date's clothes.
* The result getting the table is encoded as "no",
* "maybe", or "yes". If either of you is very stylish,
* 8 or more, then the result is yes. With the exception
* that if either of you has style of 2 or less, then
* the result is no. Otherwise the result is maybe.
*
* - input of 5, 10 -> "yes"
* - input of 5, 2 -> "no"
* - input of 5, 5 -> "maybe"
*/
/**
* Problem 2: Intermediate Selection/Logic
*
* Given 3 int values, a b c, set result to their sum.
* However, if one of the values is the same as another
* of the values, it does not count towards the sum.
*
* - input of 1, 2, 3 -> 6
* - input of 3, 2, 3 -> 2
* - input of 3, 3, 3 -> 0
*/
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images