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

c++

بدأه قلبي شموخي في 31 ديسمبر 2011 · 6 رد · 650 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ..

ارجو منكم ايضاح فكرة هذا السؤال

وطريقة كتابة الكود

This project will help teachers to explore their students' grade and find the best or worst grade in the class. Note that the maximum number of students in the class is 35 students.

Your program will allow the user to enter the class grades one grade at a time, then show a menu with the following choices:

1. Find highest.

This choice will go over the students' grades and return the highest grade in this class.

2. Find lowest.

This choice will go over the students' grades and return the lowest grade in this class.

3. Print grades.

This choice will print all the students' grades in the class.

Your programs will have the following functions:

 Main function (as usual)

 Find highest:

o This function takes as a parameter the array of students' grades and returns the highest grade.

 Find lowest:

o This function takes as a parameter the array of students' grades and returns the lowest grade

 Print grades:

o This function takes as a parameter the array of students' grades and prints them.

−2
#2

uppppppppppppppppppp

#3

uppppppppppppppppppppppppppp

#4

فكرة السؤال تدور حول فصل بة 35 طالب كحد أقصى. ومشروعك سيسمح للمدرس بأستعراض درجات الطلاب

طبعا برنامج سيمكن المدرس من ادخال درجات الفصول درجة فى المرة الواحدة وسيعرض قائمة فيها الخيارات التالية.

-أيجاد أكبر درجة من درجات الطلاب.

-أيجاد أصغر درجة من درجات الطلاب.

-طباعة الدرجات كلها.

طبعا استاذك ذكى وبيقول حتما برنامج يحتوى على الدوال التالية:

الدالة الرئيسية main وهذة طبيعى فى اى برنامج

دالة ايجاد أكبر درجة ولها وسيطة واحدة عبارة عن مصفوفة درجات التلاميذ.

دالة ايجاد أصغر درجة ولها وسيطة واحدة عبارة عن مصفوفة درجات التلاميذ.

دالة طباعة درجات التلاميذ ولها وسيطة واحدة عبارة عن مصفوفة درجات التلاميذ.

ام الكود هذا الكود الرئيسى للبرنامج

#include<iostream>
#include <stdio.h>
#include<cstdlib>
using namespace std;

float findmax(float studentarray[]);
float findmin(float studentarray[]);
float printgrads(float studentarray[]);
int *pPointer;


int main()
{
    int MaxIndex = 35;
    int choice = 0;
    float studentarray[MaxIndex] ;
    cout << "Enter ur choice " << endl
         << "1 to find Max grade."<< endl
         << "2 to find Min grade."<< endl
         << "3 to find print all grade."<< endl
         << "Plz chice one: "   ;
         cin >> choice;
         switch (choice)
         {
             case 1 : findmax(studentarray); break;
             case 2 : findmin(studentarray); break;
             case 3 : printgrads(studentarray); break;
             default : "choice right option";
         }

    std::cin.get();
    return 0;
}

float findmax(float studentarray[])
{
    cout << "Max is: ";

}

float findmin(float studentarray[])
{
    cout << "min is: ";
}

float printgrads(float studentarray[])
{
    cout << "all is: ";
}

post-15367-027053900%201340345097.gifpost-15367-087183200%201340344597.gif
post-247365-0-10080400-1379403554_thumb.

#5
int findmax(int studentarray[])

{ 

int max;
max = studentarray[0];
for(int i=1 ; i<=35 ; i++)
{
if(studentarray > max)
max = studentarray;
}
return max;

} 


int findmin(int studentarray[]) 
{ 
	int min;
	min= studentarray[0];
	for(int i=1;i<=35;i++)
	{
		if(studentarray<min)
			min=studentarray;
	}
	return min;

} 
 void printgrads(int studentarray[])

{
	for (int i=0;i<=35;i++)
		cout<<studentarray<< " " ;
	cout <<endl;
 }

ماضبطت معي الفنكشن

كذا صح؟؟؟

#6

uppppppppppppppppppp

#7

السلام عليكم

هذا مثال لإجاد أدنى قيمة و أعلى قيمة

int findMin(int * classGardes, int length)
{
	int min = 0;
	bool check = false;
	for(int i = 0; i < length ; i++)
	{
    	for(int itr = 0; itr < length; itr++)
    	{
        	if(classGardes <= classGardes[itr])
        	{
            	check = true;
        	}
        	else
        	{
            	check = false;
            	break;
        	}
    	}
    	if(check)
    	{
        	min =  classGardes;
        	break;
    	}
	}
	return min;
}
int findMax(int * classGardes, int length)
{
	int max = 0;
	bool check = false;
	for(int i = 0; i < length ; i++)
	{
    	for(int itr = 0; itr < length; itr++)
    	{
        	if(classGardes >= classGardes[itr])
        	{
            	check = true;
        	}
        	else
        	{
            	check = false;
            	break;
        	}
    	}
    	if(check)
    	{
        	max = classGardes[ i];
        	break;
    	}
	}
	return max;
}