ACTIVITY 424420 2024750 qx3zqy7 Jump to level 1 4.6.3: Arrays. Write code that loops through the array userNums. For each iteration, put userNums[i] to output, and then put to output. 1 integer i 2 integer array(3) userNums 3 4 userNums [0] 5 userNums [1] 6 userNums [2] 7 8 9 Code Get next input Get next input Get next input for i = 0; i < userNums.size; i=1+1 if userNums[1] < 0 10 11 12 Put userNums[1] to output 13 Put ";" to output 14 15 16 17 18 userNums [1] = 1 + 1 Flowchart Variables Not shown when editing Section 4.6-PRG/2. -D-D-D-

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I need help answering the question in the screenshot? I don't know what I'm doing wrong. 

CHALLENGE
ACTIVITY
4.6.3: Arrays.
424420.2024750.qx3zqy7
Jump to level 1
Write code that loops through the array userNums. For each iteration, put userNums[i] to output, and then put ";" to output.
1 integer i
2 integer array(3) userNums
3
4 userNums [0] = Get next input
5 userNums [1]
Get next input
6 userNums [2] = Get next input
7
8 for i = 0; i < userNums.size;
9
if userNums[i] < 0
10
11
12 Put userNums[i] to output
13 Put ";" to output
14
15
16
17
18
Code
userNums[i] = 1 + 1
Flowchart
i=i+1
+1 Word
Variables
Not shown when editing
Section 4.6- PRG/2...
>
D-D-D-
OC
Transcribed Image Text:CHALLENGE ACTIVITY 4.6.3: Arrays. 424420.2024750.qx3zqy7 Jump to level 1 Write code that loops through the array userNums. For each iteration, put userNums[i] to output, and then put ";" to output. 1 integer i 2 integer array(3) userNums 3 4 userNums [0] = Get next input 5 userNums [1] Get next input 6 userNums [2] = Get next input 7 8 for i = 0; i < userNums.size; 9 if userNums[i] < 0 10 11 12 Put userNums[i] to output 13 Put ";" to output 14 15 16 17 18 Code userNums[i] = 1 + 1 Flowchart i=i+1 +1 Word Variables Not shown when editing Section 4.6- PRG/2... > D-D-D- OC
: Code: Arrays
16
17
18
Code
Check
Flowchart
Try again
3
How was this section? Provide feedback
X The array's size is accessed using userNums.size. A for loop can iterate through the array userNums: Assign i with 0, iterate
while i is less than userNums.size, and assign i with i+ 1. The loop body puts userNums[i] to output, and then puts ";" to output.
Input
5 0 35
Error An array index of 3 is too large; valid range of userNums: 0-2
Input -75 45 23
Error An array index of 3 is too large; valid range of userNums: 0-2
Word
J
Section 4.6- PRG/2...
Feedback?
OC
Transcribed Image Text:: Code: Arrays 16 17 18 Code Check Flowchart Try again 3 How was this section? Provide feedback X The array's size is accessed using userNums.size. A for loop can iterate through the array userNums: Assign i with 0, iterate while i is less than userNums.size, and assign i with i+ 1. The loop body puts userNums[i] to output, and then puts ";" to output. Input 5 0 35 Error An array index of 3 is too large; valid range of userNums: 0-2 Input -75 45 23 Error An array index of 3 is too large; valid range of userNums: 0-2 Word J Section 4.6- PRG/2... Feedback? OC
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education