Answer:
Explanation:
1. Write a program that declares an array named alpha with 50 components of the type double. Initialize the array so that the first 25 components are equal to the square of the counter (or index) variable and the last 25 components are equal to three times the index variable.
double alpha[50];
for (int i=0;i<25;i++)
{
alpha[i]=i*i;
alpha[i+25]=(i+25)*3;
}
2. Output the array so that exactly ten elements per line are printed.
for (int i=0;i<50;i++)
{
cout<<i+1<<". "<<alpha[i]<<" ";
if (((i+1)%10)==0)
{
cout<<endl;
}
}
3. Run your program again, but this time change the code so that the array is filled with random numbers between 1 and 100.
double alpha[50];
for (int i=0;i<50;i++)
{
alpha[i]=rand()%101;
}
for (int i=0;i<50;i++)
{
cout<<i+1<<". "<<alpha[i]<<" ";
if (((i+1)%10)==0)
{
cout<<endl;
}
}
4. Write the code that computes and prints the average of elements of the array.
double alpha[50],temp=0;
for (int i=0;i<50;i++)
{
alpha[i]=rand()%101;
temp+=alpha[i];
}
cout<<"Average :"<<(temp/50);
5. Write the code that that prints out how many of the elements are EXACTLY equal to 100.
double alpha[50],temp=0;
for (int i=0;i<50;i++)
{
alpha[i]=rand()%101;
if(alpha[i]==100)
{
temp++;
}
}
cout<<"Elements Exacctly 100 :"<<temp;
Please note: If you put each of above code to the place below comment it will run perfectly after compiling
#include <iostream>
using namespace std;
int main()
{
// If you put each of above code here it will run perfectly after compiling
return 0;
}
Cone cells, or cones, are one of three types of photoreceptor cells in the retina of mammalian eyes. They are responsible for color vision and function best in relatively bright light, as opposed to rod cells, which work better in dim light.
C because you already have you sheet prepared
Answer:
It focuses on complete human body condition rather than single parts. The person should be healthy in all dimensions.
Explanation:
Holistic health condition is an ancient approach to a healthy life. This is a study where human is considered as healthy if he has no illness plus he is able to interact with others. he healthy condition depicts mind, soul and body. The health conditions are based on dimensions rather than single body function.
Answer:
The C++ statement for the given algebraic expression 5x^2 + 15k + y^-2 is ( ( 5 * ( x * x ) ) + ( 15 * k ) + ( 1 / ( y * y ) ).
Explanation:
To convert the given algebraic expression 5x^2 + 15k + y^-2 into the C++ statement without using the pow function is:
In the given algebraic expression, there are three expressions combined using the + operator.
The first algebraic expression is 5x^2.
Here, x has a power of 2, and 5 is multiplied by the result of x^2. x having the power of 2 means x is multiplied itself twice. The C++ statement for this algebraic expression is (5 * ( x * x)).
The second algebraic expression is 15k.
Here, 15 is multiplied by k. The C++ statement for this algebraic expression is (15 * k).
The third algebraic expression is y^-2.
Here, x has a power of -2. it means
. The C++ statement for this algebraic expression is (1/ (y * y).
The combination of all the three C++ statement is (5 * ( x * x)) + (15 * k) + (1/ (y * y).