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

Videos

Textbook Question
Book Icon
Chapter 8, Problem 6SA

Write C+ + statement(s) to do the following: (1, 2)

  1. Declare an array alpha of 50 components of type int.

  2. Initialize each component of alpha to -1.

  3. Output the value of the first component of the array alpha.

  4. Set the value of the 25th component of the array alpha to 62.

  5. Set the value of the 10th component of alpha to three times the value of the 50th component of alpha plus 10.

  6. Use a for loop to output the value of a component of alpha if its index is a multiple of 2 or 3.

  7. Output the value of the last component of alpha.

  8. Output the value of the alpha so that 15 components per line are printed. i. Use a for loop to increment every other element (the even indexed elements). j. Create a new array, diffAlpha, whose elements are the differences between consecutive elements in alpha. What is the size of dif fAlpha?

Blurred answer
Students have asked these similar questions
C++ programming Write a program that reads the grades of 3 students in three different courses and displays the average grade of each student in these three courses, as well as the average grade of all students.  You can use any loop method of your preference. (Hint: This is a nested loop technique)
Write C++ statements to do the following: Declare an array to hold 7 floating values. Assign value 3.3 to the last element in the array. Display the sum of the first two elements. Write a loop that computes the sum of all elements in the array. Write a loop that finds the minimum element in the array.
C++ Coding: Nested Loops Create a constant DIM. Set DIM to 7, and use a nested loop to display the following square matrix output. Output Example: -  -  -  X -  -  --  -  -  X -  -  --  -  -  X -  -  -X X X O X X X-  -  -  X -  -  --  -  -  X -  -  --  -  -  X -  -  -
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
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
1.1 Arrays in Data Structure | Declaration, Initialization, Memory representation; Author: Jenny's lectures CS/IT NET&JRF;https://www.youtube.com/watch?v=AT14lCXuMKI;License: Standard YouTube License, CC-BY
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License