C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
bartleby

Concept explainers

Question
Book Icon
Chapter 8, Problem 1PE
Program Plan Intro

Creation and use of one dimensional array

The following C++ program defines an array and assigns value to its elements and displays the contents.

Blurred answer
Students have asked these similar questions
Write a C++ program that declares an array alpha of 50 components of type double. Initialize the array so that the first 25 components are equal to the square of the index variable, and the last 25 components are equal to three times the index variable. Output the array so that 10 elements per line are printed.
Write a C++ program that reads 6 real numbers from the user (negative and positivenumbers) into an array, then it does the following: Display all the values of array in reverse order. Find the sum and average of positive numbers of the array and display them. Count negative numbers of the array and display it. Find the minimum value of the array and display it. Find the index of the minimum value of the array and display it.
Write a C++ program that declares an array myList of 50 components of type integer. Initialize the array so that the first 25 components are equal to the square of the index variable and the last 25 components equal to doubles the index variable. The program then calculates the sum and average of elements. In addition, the program counts elements greater than or equal to average and elements less than average. Output the array so that 10 elements per line are printed. Sample input / output: List Elements: 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 Sum of elements: 6750 Average of elements: 135 Elements greater than or equal to 135 is 13 Elements less than 135 is 37
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education