Array Question
$30-50 USD
Оплачується при отриманні
I've been given the following three programs and need the "Code here" spaces filled in. Program 1 #includevoid display(int size,int* a) { "Code here" } void addArrays(int size,int* a,int* b,int* sum) { "Code here" } int powerArray(int size,int* a,int power) { "Code here" } int main() { int arr1[]={1,2,3,4}; int arr2[]={10,20,30,40}; display(4,arr1); int* ans=new int[4]; addArrays(4,arr1,arr2,ans); dipslay(4,ans); ans=powerArray(4,arr1,2); display(4,ans); return 0; } If correct this should display the following: 1 2 3 4 11 22 33 44 1 4 9 16 Program 2 #includeint stringLength(char* source) { "Code here" } char* stringCopy(char* source) { "Code here" } char* stringAttach(char* str1,char* str2) { "Code here" } int main() { char* str1 = "Hello!"; char* str2 = "How are you?"; cout<<"\nlength of ("<<srt1<<") is:"<<stringLength(str1); char* str3=stringCopy(str2); cout<<"\n str3="<<str3; str3=stringAttach(str1,str2); cout<<"\n str1+str2="<<str3; return 0; } If correct this should display: length of(Hello!) is:7 str3=How are you? str1+str2=Hello! How are you? Program 3 #includeclass Time { private: int hour,minute,second; public: Time(int h,int m,int s); void display(); void tick(); void addSecond(int s); }; Time::Time(int h,int m,int s) { if((h>=0 && h<24) &&(m>=0 && m<60) &&(s>=0 && s<60)) {hour=h;minute=m;second=s;} else hour=minute=second=0; } void Time::display() { "Code here" } void Time::tick() { "Code here" } void Time::addSecond(int s) { "Code here" } int main() { Time t1=Time(23,59,59); [url removed, login to view](); [url removed, login to view](); [url removed, login to view](); [url removed, login to view](); return 1; } If correct this will dipslay: Time(hh:mm:ss)=00:00:00 Time(hh:mm:ss)=01:00:00
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Complete ownership and distribution copyrights to all work purchased.
## Platform
Windows 2000 I'm using Borland C++ Builder 6 to compile and run these programs.
ID Проекту: #2897476