CHALLENGE ACTIVITY 412080 2661056x3y7 Jump to level 1 Given integer variables numitems and boxCapacity, if numitems is 1
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
CHALLENGE ACTIVITY 412080 2661056x3y7 Jump to level 1 Given integer variables numitems and boxCapacity, if numitems is 1
statement checks if numitems is 150 or less using the expression numitems <= 150. If numitems is 150 or less, the branch executes and 150 is subtracted from boxCapacity. 1 2 D-D-
CHALLENGE ACTIVITY 412080 2661056x3y7 Jump to level 1 Given integer variables numitems and boxCapacity, if numitems is 150 or less, then subtract 150 from boxCapacity. Ex: If the input is 150 350, then output is: 200 3 4 int main() { 3.4.3: Working with branches. 5 int numItems; 6 7 8 9 10 11 12 13 14 15 16 17 18} Check int boxCapacity; cin>> numItems; cin>> boxCapacity; if (numItems 150 ){ boxCapacity boxCapacity 150; } cout << boxCapacity << endl; return 0; Next level 2 Feedback? An if