الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

الي يعرف classes يدخل ضروري

مغلق
بدأه طالب سي+ في 19 مارس 2007 · 6 رد · 772 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

1/ Write a grading program for a class with the following grading policies:

a/ There are two quizzes ,each graded on the basis of 10 points .

b/there is one midterm exam and one final exam ,each graded on the basis of 100 points.

c/ The final exam counts for 50% of the grade , the midterm counts for 25% ,and the two quizzes together count for a total of 25%(Do not forget to normalize the quiz scores .They should be converd to a percent before they are averaged in)

Any grade of 90 or more is an A,any grade of 80 or more (but less than 90)is a B,any grade of 70 or more (but less than 80 )is a C,any grade of 60 or more (but less than 70) is a D,and any grade below 60 is an F.

The program will read in the student's scores and output the student's record,which consists of two quiz and two exam scores as well as the student's average numeric score for the entire course and the final letter grade.Define and use a structure for the students record .if this is class assignment ,ask your instuructor if input /output should be done with the keyboard and screen or if it should be done with fi;es .if it is to be done with files ,ask your instructor for instruction on file names

اقتباس
#include <iostream>

using namespace std;

int main()

{

int id,i,score,sum=0;

double average;

char grade ,ans;

cout<<"*&*&*&WeLeCom&*&*&*\n";

cout<<"Do you want to get average of the score ? \nEnter 'Y' if you want or enter 'N':";

cin>> ans;

while (ans=='Y'||ans=='y')

{cout << "Enter your id : ";

cin >> id;

for(i=1;i<4;i++)

{cout << "Enter the "<<i<<" score: ";

cin >> score;

sum+=score;}

average =sum /3.0;

if (average>=90)

grade='A';

else if (average>=80)

grade='B';

else if (average>=70)

grade='C';

else if (average>=60)

grade='D';

else if (average<60)

grade='F';

cout.setf(ios::fixed);

cout.setf(ios::showpoint);

cout.precision(2);

cout << "ID : " << id << " \nAverage : "<< average <<"\nGrade :"<< grade <<"\n";

cout<<"Good Luck\n";

cout<<"Do you want to get average of the score ? \nEnter 'Y' if you want or enter 'N':";

cin>> ans;}

return 0;

}

هذا الي فهمته الي يعرف classes

شلون تنتكتب ساعدوني

الي يعرفها

#2
double q1,q2,m,F,part,average;
int ID;
while(ID!=0)
{
cout<<"Enter your mark in qoues";
cin>>q1;
cout<<"Enter your mark in qoues2";
cin>>q2;
cout<<"Enter your mark in midterm";
cin>>m;
cout<<"Enter your mark in final";
cin>>F;
cout<<"your ID:"<<ID<<endl;
average=(q1/0.01)+(q2/0.01)+(m/0.02)+(F/0.02)+(F/0.04);
cout<<"your average="<<average<<endl;
if(average>=60)
cout<<"you passed\n";
else
cout<<"you failed\n";
cout<<"enter you ID";
cin>>ID
}
cout<<"good_bye";
return 0;
}

مو هذاك الكود هذا الكود

#3

كلنا في الهوا سوا ..

انا ابي من ينقذني من الكلاس ..

الله يعننا على الكلاس واهله ..

#4

السلام عليكم أرجوا ان يفيدك هذا البريمج

#include <cstdlib>

#include <iostream>

using namespace std;

class student

{

private:

int q_1,q_2,m_t,f_t;

public:

void set_quizzez(int q1,int q2);

void set_mid_term(int m);

void set_final_term(int f);

void display_student_rec();

}s_1;

void student::set_quizzez(int q1,int q2)

{

q_1=q1;

q_2=q2;

}

void student::set_mid_term(int m)

{

m_t=m;

}

void student::set_final_term(int f)

{

f_t=f;

}

void student::display_student_rec()

{

double Average,q,m,f;

char score;

q=((q_1*0.5)+(q_2*0.5))*2.5;

m=m_t*0.25;

f=f_t*0.5;

Average=q+m+f;

if ((Average >= 90)&& (Average<=100))

score='A';

else if ((Average >= 80)&& (Average<90))

score='B';

else if ((Average >= 70)&& (Average<80))

score='C';

else if ((Average >= 60)&& (Average<70))

score='D';

else

score='F';

// display student record

cout<<"the student quizzes is:"<<q_1<<"\t"<<q_2<<".\n";

cout<<"the student mid_term is:"<<m_t<<".\n";

cout<<"the student final_term is:"<<f_t<<".\n";

cout<<"the student Average is :"<<Average<<".\n";

cout<<"the student score is :"<<score<<".\n";

}

int main()

{

s_1.set_quizzez(7,8);

s_1.set_mid_term(88);

s_1.set_final_term(91);

s_1.display_student_rec();

system("PAUSE");

return EXIT_SUCCESS;

}

#5

يا جماعة ممنوع حل الواجب هنا -حرام

موقوف من المشاركة لقلة الأدب

============================

#6

أرجو ان تقبلوا أعتذاري فأنا لا أعرف اين اكتب البرنامج(*عضو جديد*)؟

#7

هناك الملايين من الشروحات حول الكلاس.

وهو موضوع ليس بصعب...

لهذا كلّف نفسك وابحث... أما إذا أردت حلول جاهزة فأعزيك...

هذا الموضوع مغلق.

مواضيع مشابهة