CHALLENGE ACTIVITY 4052641475 4.9.2: Writing for loops. Jump to level 1 Write a for loop that iterates numAges times. Ea

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

CHALLENGE ACTIVITY 4052641475 4.9.2: Writing for loops. Jump to level 1 Write a for loop that iterates numAges times. Ea

Post by answerhappygod »

Challenge Activity 4052641475 4 9 2 Writing For Loops Jump To Level 1 Write A For Loop That Iterates Numages Times Ea 1
Challenge Activity 4052641475 4 9 2 Writing For Loops Jump To Level 1 Write A For Loop That Iterates Numages Times Ea 1 (22.11 KiB) Viewed 42 times
CHALLENGE ACTIVITY 4052641475 4.9.2: Writing for loops. Jump to level 1 Write a for loop that iterates numAges times. Each iteration: Assign userAge with the next input. Then, assign subResult with subResult minus userAge. Then, put subResult to output. Then, put to output. Ex: If input is: 42 7 5 3, then output is: -2,-9,-14,-17, 1 integer numAges 2 integer userAge 3 integer subResult 4 integer i S 6 // Program tested with three inputs: 7 // First: 42753 8// Second: 6123456 9// Third: -1538 Get next input 10 numAges 11 subResult-0 I 12 13 for sublesult = 0; subResult nunAges; subResult su 14 userAge 15 subResult Get next input. subResult 16 Put subResult to output userAge Variables Not shown when editing >
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply