Write C++ statements to do the following: i. Declare an empty aray DATA to hold 7 double floating values. ii. Assign value 5.7 to the last element in the array. Display the sum of the first two elements without using extra memory variable. Write a while-bop that computes the sum of all elements in the array. V. iii. iv. Write a while-loop that finds the minimum element in the array. vi. Randomly generate an index and display the element at this (randomly generated) index in the array. Use an array initializer to declare another array with initial values 5.78, 12.69, 10.45, and 19.0. vii.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false. A double type is an example of a simple data type....
icon
Related questions
Question

Required part 5,6,7

 

Write C++ statements to do the following:
i.
Declare an empty array DATA to hold 7 double floating values.
ii.
Assign value 5.7 to the last element in the array.
iii.
Display the sum of the first two elements without using extra memory variable.
iv.
Write a while-loop that computes the sum of all elements in the array.
Write a while-lop that finds the minimum element in the array.
vi.
V.
Randomly generate an index and display the element at this (randomly generated) index in
the array.
Use an array initializer to declare another array with initial values 5.78, 12.69, 10.45, and
vii.
19.0.
Transcribed Image Text:Write C++ statements to do the following: i. Declare an empty array DATA to hold 7 double floating values. ii. Assign value 5.7 to the last element in the array. iii. Display the sum of the first two elements without using extra memory variable. iv. Write a while-loop that computes the sum of all elements in the array. Write a while-lop that finds the minimum element in the array. vi. V. Randomly generate an index and display the element at this (randomly generated) index in the array. Use an array initializer to declare another array with initial values 5.78, 12.69, 10.45, and vii. 19.0.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Fundamentals of Computer System
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr