Write C++ statements to define and initialize the following arrays. a. Array hei
ID: 3845163 • Letter: W
Question
Write C++ statements to define and initialize the following arrays. a. Array heights of 10 components of type double Initialize this array to the following values: 5.2, 6.3, 5. 8, 4. 9, 5.2, 5.7, 6. 7, 7.1, 5. 10, 6.0. b. Array weights of 7 components of type int. Initialize this array to the following values: 120, 125 137, 140, 150, 180, 210. c. Array specialSymbols of type char. Initialize this array to the following values: exist, #, %, @, & !,, ^. d. Array seasons of 4 components of type string. Initialize this array to the following values: "winter", spring", "Summer", "autumn".Explanation / Answer
4)
a) double heights[10]={5.2,6.3,5.8,4.9,5.2,5.7,6.7,7.1,5.10,6.0};
b)int weights[7]={120,125,137,140,150,180,210};
c)char specialSymbols[7]={'$','#','%','@','&','!','^'};
d)char seasons[4][7] = {"winter", "spring", "summer","autumn"};
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.