• Announcements

    • Peraturan Umum, Sila baca !

      1) Perbincangan illegal , seperti download , provide link muat turun, lanun sebagainya ditegah dan akan dipadam tanpa notis. Sila ambil perhatian , sebarang perbincangan mengenai download men-download, sharing link yang berkait kepada illegal material: - akan dipadam serta merta - tiada kompromi, user akan diberi warn jika melakukan kesalahan sama Contoh related : - " aku tengah sedut ni.. sejam lagi siap.. " - " kat mana ko dload laju gile.. aku lagi 14 hari nk siap" 2) Spamming, double pos, smiley semata-mata adalah satu kesalahan besar, elakkan membuat susulan pos dibawah susulan sendiri. Warning tanpa notis akan diberikan. 3) Elakkan drama fanboyism , samada berkait dengan konsol, permainan pc dan sebagainya 4) Perbincangan private server tidak dibenarkan, namun multiplayer via hamachi group dibenarkan. 5) Cheat codes dibenarkan, tetapi tidak kepada [email protected] 6) Screenshot seeloknya bersaiz 640 x 480 ke bawah, sila gunakan code spoiler sekiranya tidak resize pic anda. 7) One line posting (susulan satu baris) tanpa menjawab persoalan dan tidak memberi apa-apa manfaat dikira sebagai SPAM. SILA GUNAKAN FUNGSI REPORT JIKA TERDAPAT USER/TOPIK YANG MELANGGAR PERATURAN DI ATAS. ____________________________________________________________ _______________________________ .::. Kegagalan mematuhi terma dan syarat boleh mengakibatkan posting anda di padam dan anda mendapat warn level secara percuma .::. ____________________________________________________________ _______________________________
Sign in to follow this  
Followers 0

Assgment C++

2 posts in this topic

Posted · Report post

[b] salam....nk mntk ckit boleh tak..nak tanya pasal soalan C++ ini...saya tak dapat nak jawab...harap kwn2 dapat tolong

Write a C++ program to calculate the average of a set of grades and counting the number of failing test grades, the output are shown as following:-

How many grades will you be entering? 7
... Enter grade #1 : 93
Enter grade #2 : 63
Enter grade #3 : 87
Enter grade #4 : 65
Enter grade #5 : 62
Enter grade #6 : 88
Enter grade #7 : 76
Grade average = 76.29
Number of failures = 2[/b]

Share this post


Link to post
Share on other sites

Posted · Report post

soalan ko ni x jelas.markah fail brp?aku malas btl kalo buat keje soalan yg x jelas.coding ni aku assume markah fail bawah dr average.

[CODE]#include <iostream>

using namespace std;

void main () {

int index, sFail=0;
double tot=0, avg=0;
double* t;

cout<<"How many grades will you be entering? ";
cin>>index;

t = new double[index];

for (int a=0; a<index; a++) {
cout<<"Enter grade #"<<a+1<<" : ";
cin>>t[a];

tot = tot + t[a];
}

avg = tot / index;

for (int b=0; b<index; b++) {
if ( t[b] < avg )
sFail = sFail+1;
}

cout<<"Grade average = "<<avg<<endl;
cout<<"Number of failures = "<<sFail<<endl;
}[/CODE]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0