Time remaining:
c programming arrays help

Programming
Tutor: None Selected Time limit: 0 Hours

Type your programming question here...
  1. Consider the following function main and copy it into a file to be run later:

#include <stdio.h>

int main()

{

int alpha[20];

int beta[20];

int gamma[4];

int delta[10];

gamma[0]  = 11; gamma[1]  = 13; gamma[2]  = 15; gamma[3]  = 17;

delta[0] = 3; delta[1] = 5; delta[2] = 2; delta[3] = 6; delta[4] = 10;


a.  create the code that prompts the user to input 20 numbers and stores the numbers into alpha.

b.  write the code that initializes the elements in beta to 2 times the corresponding values in alpha. Make sure NOT to modify the values in alpha.

c.  create the code that displays all of the values in alpha.

(submit has hw9.5.c and hw9.5 (output))


Nov 20th, 2013
increase the pledge i will do it for you.
Nov 20th, 2013

i have completed this code just increase it $3 please so that i can post solution.

Nov 20th, 2013
#include <iostream> 
using namespace std; 

int setZero(int a[],int n); 

void inputArray(int alpha[]); 

double doubleArray(int beta[],int alpha[]); 

int copyGamma(int inStock[][],int gamma[]); 

void copyAlphaBeta(int inStock[][],int alpha[],int beta[]); 

int printArray(int a[],int n); 

int main() 



int inStock[10][4]; 

int alpha[20]; 

int beta[20]; 

int gamma[4] = {11, 13, 15, 17}; 

int delta[10] = { 3, 5, 2, 6. 10, 9, 7, 11, 1, 8 }; 


return 0;// Ends the program 
}// End of function main 


int setZero(int a[],int n) 



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


a[i]=0; 





void inputArray(int alpha[]) 



cout<<"Enter 20 numbers: "; 

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



cin>>a[i]; 





double doubleArray(int beta[],int alpha[]) 



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



beta[i]=2*alpha[i]; 






int copyGamma(int inStock[][],int gamma[]) 



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

for(int j=0;j<4;j++) 

if(i==0) 



inStock[i][j]= gamma[j]; 



else 



inStock[i][j]=3*inStock[i-1][j]; 





void copyAlphaBeta(int inStock[][],int alpha[],int beta[]) 


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

for(j=0;j<4;j++) 

if(i<5) 


inStock[i][j]=alpha[j]; 



else 


inStock[i][j]=beta[j]; 






int printArray(int a[],int n) 



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



if(i%15==0) 


cout<<endl; 

cout<<a[i]<<" "; 









void setInStock(int inStock[][],int delta[]) 


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

for(int j=0;j<4;j++) 



if(j==0) 



cout<<"Enter the value: "; 

cin>>inStock[i][j]; 



else 


inStock[i][j]= 2*inStock[i][j-1] - delta[j]; 





This is the Complete and fully functional code please pay the pledge thanks :)
Nov 20th, 2013

thank you so very much

Nov 21st, 2013

please pay the pledge thanks

Nov 21st, 2013

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Nov 20th, 2013
...
Nov 20th, 2013
Dec 10th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer