- Challenge Activity 412080 2661056 Qxczy Jump To Level 1 3 4 4 Working With Ranges Given Integer Variable Numbikes Is 1 (33.71 KiB) Viewed 31 times
CHALLENGE ACTIVITY 412080 2661056.qxczy? Jump to level 1 3.4.4: Working with ranges. Given integer variable numBikes is:
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
CHALLENGE ACTIVITY 412080 2661056.qxczy? Jump to level 1 3.4.4: Working with ranges. Given integer variable numBikes is:
CHALLENGE ACTIVITY 412080 2661056.qxczy? Jump to level 1 3.4.4: Working with ranges. Given integer variable numBikes is: greater than 42, output "Need multiple racks". between 15 and 42 inclusive, output "Double bike rack". between 0 and 14 inclusive, output "Small bike rack". • less than 0, output 'Bad input". End with a newline. Ex: If input is 43, then output is: Need multiple racks 0 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 if (numBikes > 42 ){ cout<<"Need multiple racks" << endl; } else if (numBikes > 15 ){ numBikes < 42; cout << "Double bike rack" << endl; } else if (numBikes > 0) { numBikes < 14; cout << "Small bike rack" << endl; } else if (numBikes < 0){ cout << "Bad input" << endl; } return 0; 1 2 3 2 3