سنتر العرب
 

ماشاء الله تبارك الله ماشاء الله لاقوة الا بالله , اللهم اني اسالك الهدى والتقى والعفاف والغنى

   

 

 

    تويتر فيس بوك

 

Loading


العودة   منتديات سنتر العرب > سنتر العرب - الاقسام العامة > سنتر العرب - الأنترنت والكمبيوتر و الـ DSL > سنتر العرب لخدمات الويب > لغات البرمجه, php , asp,Ajax, visual basic Java

لغات البرمجه, php , asp,Ajax, visual basic Java لغات البرمجه, php , asp,Ajax, visual basic Java,لغات البرمجه, php , asp,Ajax, visual basic Java,لغات البرمجه, php , asp,Ajax, visual basic Java,لغات البرمجه, php , asp,Ajax, visual basic Java,


أتمنى المساعدة بأسرع ما يمكن ..

لغات البرمجه, php , asp,Ajax, visual basic Java


إضافة رد
 
أدوات الموضوع
قديم 01-23-2009, 06:03 PM   رقم المشاركة : [1]
fahd1162
عضو جديد
 




fahd1162 will become famous soon enough

 
افتراضي أتمنى المساعدة بأسرع ما يمكن ..

هل من الممكن يا اخواني ان تساعدوني او تعطوني على الاقل الفكره

وجزيتم الفردوس الاعلى

اولا وصف المشكله:




كود:

كود PHP:
[left]
#ifndef STUDENT
#define STUDENT
 
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
 
class 
Student{
private:
    static 
int serialId;
    
int id;
    
float midTerms[2];
    
float quizzes[3];
 
 
public:
    
Student():id(serialId){
        
midTerms[0] = midTerms[1]= 0;
        
quizzes[0] = quizzes[1] = quizzes[2]=0;
        
serialId++;}
 
    
int getId(){return id;}
    
float getMidTermMark(int midTerm){return midTerms[midTerm-1];}
    
float getQuizMark(int quiz){return quizzes[quiz-1];}
 
 
    
//Sets the mark of the given midterm 
    
bool setMidTermMark(int midTermfloat mark){
        if (
midTerm==|| midTerm==2){
            if (
mark >= && mark <= 20){
                
midTerms[midTerm-1] = mark; return true;
            }
        }
        return 
false;
    }
 
    
//Sets the mark of the given Quiz 
    
bool setQuizMark(int quizfloat mark){
        if (
quiz >|| quiz <=3){
            if (
mark >= && mark <= 5){
                
quizzes[quiz-1] = mark;    return true;
            }
        }
        return 
false;
    }
 
    
//Outputs formatted information to given output stream
    
void outputLine (ostreamouts){        
        
outs << "\t ID: " << id << endl;
        
outs << "\t Midterms: midterm1=" << midTerms[0] << ", midterm2=" << midTerms[1] << endl;
        
outs << "\t Quizzes: quiz1=" << quizzes[0] << ", quiz2=" << quizzes[1] << ", quiz3=" << quizzes[2]<< endl << endl;
    }
 
    
friend bool operator==(const Students1, const Students2);
};
 
 
 
/* Writes the binary representation of the given student object into the given
* file stream, in the appropriate position in the file according to the students ID. Meaning
* that in the file, students should be stored in the file in order of student ID. 
*/
 
void writeToFileStream(fstreamfileStudentstudent);
 
 
 
 
/* Updates the information of a student by replacing the old student data with 
* new one. If a student object with the same ID is not stored in the file, do NOT write it 
* in the file.
* The old and new data must be displayed on the screen to the user.
*/
 
bool updateFileStream(fstreamfileStudentupdatedStudent);
 
 
/* Reads information of a student stored in the file stream and prints it on the
* screen. If a student object with the given ID is not stored in the file, inform 
* the user. 
*/
 
void readFileStream(fstreamfileint studentID);
 
 
 
/* Deletes information of a student stored in the file stream. If a student 
* object with the given ID is not stored in the file, inform the user. 
*/
 
void DeleteFromFileStream(fstreamfileint studentID);
 
 
//============ E N D O F A S S I G N M E N T ==============================
 
/*
* Bonus Question ONE (2 Marks): Write a global function that calculates the average 
* of each assessment for all students in the file then writes them in another text 
* file named: avg.txt, the file should be formatted as follows:
*         Mid 1 avg: ...                 
*         Mid 2 avg: ...                 
*         quiz 1 avg: ...
*         quiz 2 avg: ...
*         quiz 3 avg: ...
*/
 
void AvgFileStream(fstreamfile);
 
 
/*
* Bonus Question TWO (2 Marks): Write a function that reads each student object in the file,
* then composes a username in the form:
*         CSI<studentID>@imamu.edu.sa
* and saves it in a text file called usernames.txt 
*/
 
void generateUserAccounts(fstreamfile);
 
 
 
#endif
 

[/left
ثانيا الحل



كود:
كود PHP:
[left]
/*
* Student Name:
* Student ID:
* Student Section:
*/ 
 
#include "ProblemDe******ion.cpp"
 
int Student::serialId = -1;
 
/*
* Global Variable to be used in functions. 
* Do NOT define new objects inside the global functions.
*/ 
const Student blankStudent//Use when you need an empty Student object
Student tmpStudent;         //Use when you need a temprary Student object to read/write data
 
 
 
void writeToFileStream(fstreamfileStudentstudent){
 
    
//WRITE FUNCTION BODY
 
    
fstream file("studentinformation.txt",ios::in|ios::binary);
    
file>>student
 
}
 
 
bool updateFileStream(fstreamfileStudentupdatedStudent){
 
    
//WRITE FUNCTION BODY
 
    
return false;
 
}
 
 
void readFileStream(fstreamfileint studentID){
 
    
//WRITE FUNCTION BODY
 
}
 
 
void DeleteFromFileStream(fstreamfileint studentID){
 
    
//WRITE FUNCTION BODY
 
}
 
 
 
//Optional Bonus. Do not change it if you do not want to solve it.
void AvgFileStream(fstreamfile){}
 
 
//Optional Bonus. Do not change it if you do not want to solve it.
void generateUserAccounts(fstreamfile){}
 
 

[/
left
كود PHP:
[left]
/*
* Student Name:
* Student ID:
* Student Section:
*/ 
 
#include "ProblemDe******ion.cpp"
 
int main(){
    
cout<<"Testing File IO.." << endl << endl;
 
 
    return 
0;
}
<
div align="left">ثالثا المين
 
 
 

<div align="left">كود:</div></div
مو لازم الحل بس اشرحوا لي ايش اعمل؟
[/LEFT]

fahd1162 غير متواجد حالياً   رد مع اقتباس
قديم 01-23-2009, 11:09 PM   رقم المشاركة : [2]
درع الجزيرة
المدير العام

 الصورة الرمزية درع الجزيرة
 





درع الجزيرة will become famous soon enough

 
افتراضي

توااااصل مع عناااد الشوووق
على الخااااااص
وسيفيدك انشااء الله

توقيع درع الجزيرة
 

لا شفت ضيم الناس في كل ديرة ،،، أسجد لربي اللي خلقني سعودي




درع الجزيرة متواجد حالياً   رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)


الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 
أدوات الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML متاحة

الانتقال السريع

  Bookmark and Share

  


الساعة الآن 01:16 PM

|

www.swsws.net® Version 3.8.6
Copyright ©2000 - 2012, 7: swsws Ltd.
تنبية جميع ما يتم كتابته في المنتدى يعبر عن رأي كاتبه فقط ولا تتحمل إدارة منتديات سنتر العرب أدنى مسؤولية

Security team