Create a program which does the following: 1. Asks the user for 5 numbers and stores them in an array. 2. Prints out the numbers entered. 3. Stores the index numbers where the user input values are greater than than 100.

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
### Program Assignment

#### Objective:
Create a program which performs the following tasks:

1. **Input Collection**:
    - Asks the user to input 5 numbers and stores them in an array.

2. **Output Display**:
    - Prints out the numbers entered by the user.

3. **Index Storage**:
    - Stores the index numbers where the user input values are greater than 100.

#### Detailed Explanation:

1. **Asks the user for 5 numbers and stores them in an array**:
    - Your program should prompt the user to enter 5 numeric values. As the values are entered, they should be stored in a data structure known as an array. Arrays are a type of collection that holds multiple items of the same type, in this case, numbers.

2. **Prints out the numbers entered**:
    - After all five numbers have been entered and stored, your program should display these numbers back to the user. This step ensures that the input has been correctly recorded.

3. **Stores the index numbers where the user input values are greater than 100**:
    - Your program should then examine each of the numbers in the array. If a number is greater than 100, the program should note the position (index) of that number within the array. These index positions should be stored for further use or display.

### Example:
For instance, if the user inputs the numbers [50, 150, 200, 70, 125], the steps will proceed as follows:
- The array will be [50, 150, 200, 70, 125].
- The program will print the array: `50, 150, 200, 70, 125`.
- The program will store the indices `[1, 2, 4]` since the numbers at these positions (150, 200, 125) are greater than 100.

By following these steps, this program helps in learning basic array operations, user input handling, and conditional logic to process and filter array elements.
Transcribed Image Text:### Program Assignment #### Objective: Create a program which performs the following tasks: 1. **Input Collection**: - Asks the user to input 5 numbers and stores them in an array. 2. **Output Display**: - Prints out the numbers entered by the user. 3. **Index Storage**: - Stores the index numbers where the user input values are greater than 100. #### Detailed Explanation: 1. **Asks the user for 5 numbers and stores them in an array**: - Your program should prompt the user to enter 5 numeric values. As the values are entered, they should be stored in a data structure known as an array. Arrays are a type of collection that holds multiple items of the same type, in this case, numbers. 2. **Prints out the numbers entered**: - After all five numbers have been entered and stored, your program should display these numbers back to the user. This step ensures that the input has been correctly recorded. 3. **Stores the index numbers where the user input values are greater than 100**: - Your program should then examine each of the numbers in the array. If a number is greater than 100, the program should note the position (index) of that number within the array. These index positions should be stored for further use or display. ### Example: For instance, if the user inputs the numbers [50, 150, 200, 70, 125], the steps will proceed as follows: - The array will be [50, 150, 200, 70, 125]. - The program will print the array: `50, 150, 200, 70, 125`. - The program will store the indices `[1, 2, 4]` since the numbers at these positions (150, 200, 125) are greater than 100. By following these steps, this program helps in learning basic array operations, user input handling, and conditional logic to process and filter array elements.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
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
  • SEE MORE 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