English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Okay, so here's the link for the problem http://www.pic.ucla.edu/~nathan/cgi-bin/moin.cgi/la1
I'm having trouble on the first part.
For the first function

intialize_array: I'm confused on how I can get the print_array function to print out NA's.. If I just initialize all values in the array to a default value such as -1, then ask the print_array function to print out the values, the values will read 'NA'?

for example:
(initialize_array(int a[],int n1) {
for (int i =0; i < a[n1]; i++)
a[i] = -1;
a[n1] = n1;


Also, for the copy_array function.. i wasn't sure if i was approaching this right

copy_array(int a[], int n1, int b[], int n2);
for(int i =0; i < n1+1; i++)
b[i] = a[i];
b[n2] = n2;

thanks so much

2007-01-28 12:57:03 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

thanks for your help..
as for your question, many colleges want applicants that are well rounded.. especially students who have taken on leadership positions.. try to get involved in school, join sports, clubs, leadership, etc.. Also, there are SAT classes that will help you practice and score well. THey will teach you necessary techniques and some even guarantee a pretty good minimum score.
On top of that, the essay or personal statement can be pretty important. Try to start this early, and choose a topic that will really touch them. Counselors usually offer a lot of advice and will help you a lot.
Also, There may be organizations (such as EAOP or EAP or something like that) that will read and edit your personal statements..
good luck!

2007-01-28 13:56:41 · update #1

3 answers

First, you need to implement your array as vector. Second, you have to use your array.size() to know *where* to put some value.
Read this, it will help:
http://www.sgi.com/tech/stl/Vector.html

2007-01-28 14:17:13 · answer #1 · answered by alakit013 5 · 0 0

I am 15 so here its goes. I am a beginner.

first create a for loop that will deposit the numbers like

for (int i =0; i < a[n1];){
cout << "ENTER A num:";
cin >> array[i]; // I did a array[ i] because the for loop will try all the possible nums it will be less than a[n1] so if it start from 1 then the first num be story in arry[1]
cout << "WANNA ENTER ANOTHER NUM[Y/N]";
cin >> more; // create a char called cin so u can desposit more num if the user wants.
if(more == 'n')
break;
}else{
i++;
}

then later if u want to recall the array back use this loop

for (int i =0; i < a[n1];){
cout << "array" << i << " is " << array[i] << endl; // will say Array 1 = etc and so on.
}

HOPE THIS HELPS.

~~HELP ME~~
I am 15 and I am learning programming. I have a 4.0 GPA but I think I won't get higher than 700 on the SAT so How do i get into a good college.

2007-01-28 13:08:36 · answer #2 · answered by Best Helper 4 · 0 0

i'm no longer one hundred%. Why no longer loop from the starting up handle (i.e. ptr) till eventually you hit a null (which shows the end of the dispensed area) and count number the type of ones and zeros. at the same time as(*ptr != null){ if(*ptr == a million){ improve the a million's counter; } else if (*ptr == 0){ improve the 0's counter; } ptr++; }

2016-12-03 04:18:45 · answer #3 · answered by ? 4 · 0 0

fedest.com, questions and answers