|
Salam,
Nak minta tolong kat kawan2 cari.forum yg pandai dlm c++ programming. Anak buah saya ni tak rreti buat assignment. Jadi nak minta tolong kawan2 kat sini sape2 yg free & ada ilmu, sudi-sudilah tolong... . Saya ni pun tak pandai buat..al-maklumlah tak pernah belajar pulak subject programming nie... eheheeh...
Soalannya.
a. Write a program that uses an one-dimensional array to store five numbers. The program should output a menu that allows user to select any one of the following tasks; the highest number, the lowest number, the odd number(s), the even number(s). Calculate average amount stored and sort these numbers in the array. Your program must include the following functions:
|
|
|
|
|
|
|
|
die blaja mana? aku da lupe la mende2 mcm ni...
dulu mase blaja mmg aku minat gak bende2 mcm ni... |
|
|
|
|
|
|
|
kah2...aku penh wat soaln mcm nih dulu...tp xtau dh cmpk mn assignment nih... |
|
|
|
|
|
|
|
huhu..penah jugak..nnt kene study blk kalo nk buat.hehe
tp skg tgh bz projek...ble nk kene anta tue? |
|
|
|
|
|
|
|
haha aku dh lupa sumer coding c++...
tp c++ simple jer la..cr la tutorial.. |
|
|
|
|
|
|
|
btol2..
aku ni tga blaja lg nieh...
major in progrmming plak 2..
tpi semenjak da 1 year aku tingl kan c++ agak lupe gak la..
nnt aku akan try tlg kalo aku ingt..
tpi na kne semak buku balik la..
skang ni aku tga blaja c#
nek pening da pale otak aku....
btw..
kalo c++ try la carik tutorial kat tenet..
tutorial c++ tu agak senang tok di fahami... |
|
|
|
|
|
|
|
aku tgh free...sat aku tolong tgk... |
|
|
|
|
|
|
|
ni cth yg aku dah buat.x siap sepenuhnya.tp dlm 15% tu ada la.biasa la bnd2 free ni nak buat smpi habis semangat kurang sikit.hehehe...so paham2 jerk la..
[code]
#include <iostream>
using namespace std;
int createarray (int []);
int displaymenu();
void highest (int []);
void main()
{
int input[5] = {0,0,0,0,0};
createarray (input);
/*for (a=0;a<5;a++) {
cout<<"Nombor yg ke-"<<a+1<<" ialah : "<<input[a]<<endl;
}*/
if (displaymenu() == 1)
highest (input);
}
int createarray (int nombor[])
{
int b;
for (b=0;b<5;b++) {
cout<<"Masukkan nombor yg ke-"<<b+1<<" : ";
cin>>nombor;
}
return nombor[5];
}
int displaymenu()
{
int choice;
cout<<"\nPress 1 for display highest number in the array"<<endl;
cout<<"Press 2 for display lowest number in the array"<<endl;
cout<<"Choice : ";
cin>>choice;
return choice;
}
void highest (int num[])
{
int a, besar, temp;
temp = num[0];
for (a=1;a<5;a++)
if (num[a] > temp)
besar = num[a];
cout<<"Nombor terbesar ialah : "<<besar<<endl;
}
[code] |
|
|
|
|
|
|
|
Rasa macam baru sangat aku jumpa tugasan yang sama ni.... |
|
|
|
|
|
|
|
banyak dah lupa semua programming ni....... trapi shahnaz adakan |
|
|
|
|
|
|
|
ada tapi dah menghilang |
|
|
|
|
|
|
| |
|