Define the following arrays:
A) ages, a 10-element array of ints initialized with the values 5, 7, 9, 14, 15, 17, 18, 19, 21, and 23.
B) temps, a 7-element array of floats initialized with the values 14.7, 16.3, 18.43, 21.09, 17.9, 18.76, and 26.7.
C) alpha, an 8-element array of chars initialized with the values 'J’, ‘B’, ‘L’, ‘A’, ‘*’, ‘$’, ‘H’, and ‘M’.
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Additional Engineering Textbook Solutions
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Concepts Of Programming Languages
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Thermodynamics: An Engineering Approach
Degarmo's Materials And Processes In Manufacturing
Java: An Introduction to Problem Solving and Programming (8th Edition)
- Two dimension array in C:Create a two dimension array of integers that is 5 rows x 10 columns.Populate each element in the first 2 rows (using for loops) with the value 5.Populate each element of the last three rows (using for loops) with the value 7.Write code (using for loops) to sum all the elements of the first three columns and output thesum to the screen.arrow_forwardq8) In the array below B[10]: 6 15 8 1 5 9 10 36 29 12 what is the value of R= B[9] + B[2] = _____________ a. 29 b. 44 c. 20 d. 27arrow_forwardc#arrow_forward
- C Program Functions with 2D Arrays Write a function named displayElements that takes a two-dimensional array, the size of its rows and columns, then prints every element of a two-dimensional array. Separate every row by a new line and every column by a space. In the main function, write a program that asks for integer input to be assigned on a 3 x 3 array and call the function displayElements to print the contents on the next line. Input 1. Multiple lines containing integer each line Output R1C1: 1 R1C2: 2 R1C3: 3 R2C1: 4 R2C2: 5 R2C3: 6 R3C1: 7 R3C2: 8 R3C3: 9 1 2 3 4 5 6 7 8 9arrow_forward1. Define an array called grades with type char and size 10 2. Write a for loop to initialize the above array with value 'A' 3. Write a nested for loop to print out a 2d array in a table format. The name of the array is called values, 5 rows and 10 columnsarrow_forwardJavaarrow_forward
- Java program 2D ARRAYarrow_forwardWrite a recursive function that returns True if the numerical array passed as input is palindrome, and False otherwise. An array is palidrome if its elements, when flipped, produce an array that is identical to the original one. For example: [1,2,3,2,1] is palindrome [1,2,3,4,3] is not palindrome Fill in the following code skeleton. It is composed of four parts: three base cases and the recursive call. Write code for all the parts. Assume that the input arrays can have any size, and that the elements are always positive integers.arrow_forwardXy---6. code.arrow_forward
- Define BaseAddress Of An Array.arrow_forwardJava Objective:Design and implement simple matrix manipulation techniques.Details:Your java program should use 2D arrays to implement simple matrix operations.Your program should do the following:• Read the number of rows and columns of a matrix M1 from the user. Use an input validation loop to make sure the values are greater than 0. • Read the elements of M1 in row major order• Print M1 to the console; make sure you format as a matirx• Repeat the previous steps for a second matrix M2• Create a matrix M3 that is the transpose of M1 and print it to the console• Check if M1 and M2 can be added (should have the same dimensions). If possible, add M1 and M2 and print the result to the console. Otherwise print an error message.• Multiply M1 and M2 if possible and print to the console. If the matrices cannot be multiplied, print an error message. Implementation requirements:• Use a helper method for reading a positive integer using an input validation loop.• Use a helper method for printing…arrow_forwardReview the following data structures in R: Arrays. Access R Studio. Then, demonstrate how to work with each Arrays as outlined below. Arrays Create an array of movies that contains the Top 10 movies of 2020.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning