1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Firlakuza [10]
3 years ago
5

Write a C++ program that declares an array alpha of 50 components of type double. Initialize the array so that the first 25 comp

onents are equal to the square of the index variable (the position that element will occupy), and the last 25 components are equal to three times the index variable. Output the array so that 10 elements per line are printed. For the number at index 5, the value would be 25, which is 5 squared. The 25th index would hold a value of 75, which is 3 * 25.
Computers and Technology
1 answer:
pshichka [43]3 years ago
7 0

Answer:

#include <iostream>

#include <array>

static std::array<double, 51> nums;

int main()

{

std::array<double, 51> nums;

int for1;

int for2;

for (int i = 0; i < 26; i++)

{

             nums[i] = i;

             for1 = i * i;

             std::cout << for1 << ", ";

             if(i%10==0)

                 std::cout << "\n";

}

for (int i = 26; i < 51; i++)

{

             nums[i] = i;

             for2 = i * 3;

             std::cout << for2 << ", ";

             if (i % 10 == 0)

                 std::cout << "\n";

}

}

hope i helped :D

You might be interested in
What is autofill in a excel spreadsheet?
Digiron [165]
Autofill is to automaticlly put the information in a spreadsheet
5 0
3 years ago
Which musical instrument would have the lowest pitch ?
Oduvanchick [21]

Answer: subcontrabass  tuba, then octocontra bass clarinet, then organ.

Explanation:

8 0
3 years ago
Interview Questions for a game developer help needed
Katyanochek1 [597]

Answer:

just be truthful

Explanation:

8 0
4 years ago
List 10 programs or applications on your computer other than any Microsoft office programs
Fofino [41]
Dropbox
Mozilla Firefox, Google Chrome
Gmail, Mozilla Thunderbird
CDburnerXP
Putty, Netflix,
Paint.net, Filezilla
3 0
3 years ago
Can someone else kill Raz and I can still get the challenge done by collecting the artifact in fort nite?
Margarita [4]
No Stop playing fort nite and play warzone
8 0
3 years ago
Other questions:
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • How can you best utilize CSS for Web Development?
    6·1 answer
  • Cryptanalysis is made more difficult by having shorter keywords.a) trueb) false
    6·1 answer
  • What data unit is addressed based on the IP address of the recipient?
    8·1 answer
  • Write an Assembly program in MIPS that does the following:
    7·1 answer
  • You wrote a program to allow the user to guess a number. Complete the code to generate a random integer from one to 10.
    8·2 answers
  • Việc áp dụng khai báo hải quan điện tử có áp dụng chữ ký số, đem lại những lợi ích gì
    10·1 answer
  • I need help with computer science<br> the quiz on e2020 is on hackers and unauthorized access
    15·2 answers
  • Write a description about this picture
    13·2 answers
  • Which of the following best describes a balanced reaction
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!