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

ارجو مساعدتي في برنامج class

مغلق
بدأه bebe في 17 أكتوبر 2005 · 0 رد · 400 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1

السلام عليكم ورحمة الله وبركاته ارجو مساعدتي في هذا البرنامج والذي انزلت من قبل في المنتدى as homework واعتذر لمشرفي المنتدى لاني لم أقرأ قوانيين المنتدى ولكن ارفقت في هذا االموضوع ملف مرففقبمحاولتي فارجو ارشدي لاخطأي حتى استطيع اكماله

وشكرا لكم

Problem #1:

• Define a class called StudentType that holds information about a student (student ID, first name, last name, major).

• Implement each member function (set, get, print, constructor, … etc) in the class.

Problem #2:

• Define a class called CourseType that holds information about a course (course code, course title, number of credits).

• Implement each member function (set, get, print, constructor, etc.) in the class.

Problem #3:

• Define a class called RecordType that holds information about the courses that a student has already taken (student ID, course code, course total mark, course grade, semester taken).

• Implement each member function (set, get, print, constructor, etc.) in the class.

Problem #4:

Write a number of member functions that do the following:

• Calculate the student GPA

• Search for the highest mark taken in a particular course

• Print the ID, first name, and last name of all the students who have already taken a particular course

• Print the course code, course title, course mark, course grade of all courses taken by a particular student

Problem #5:

Write a main program that does the following:

• Define an array of objects of each one of the above three classes

• Assign data to the objects that you defined. This data should be stored and read from 3 different files

• Read a student ID

• Print a list of all courses taken by that student

• Calculate the GPA of that student

• Read a course code

• Print the ID, first name, and last name of all the students who have taken that course

• Search for the highest mark taken in that course

• Print the ID, first name, and last name of the student who scored that highest mark in that cour

// "studentType.h"

class studentType
{
private:
	int id;
	string name;
  string last;
  string major;
public:
	void set(int,string,string,string);
	void get(int,string,string,string);
	studentType();
	void print();

};

class courseType
{
private:
	int code;
	string title;
	int credit;
public:
	void set(int,string,int);
	void get(int,string,int);
	courseType();
     void print();

};
class recordType
{
private:
	int id;
	int coursecode;
	double total;
	string grade;
	int semster;
public:
	void set(int,int,double,string,int);
	void get(int,int,double,string,int);
	recordType();
	void gpa();
	void highmark();
	void print();
}



[code]#include <iostream>
#include <string>
#include "studentType.h"
using namespace std;




 void studentType::set(int i,string n,string l,string m)
{
 id=i;
 name=n;
 last=l;
 major=m;
 for(int i=0;i<=15;i++)
  infile>>id>>name>>last>>major;
}
studentType::studentType(int i,string n,string l,string m)
{
 id=i;
 name=n;
 last=l;
 major=m;
 f
}
 void student::get(int i,string n,string l,string m)
{
  infile>>
	i=id;
	n=name;
	l=last;
	m=major;
}
studentType::studentType()
{
	id=0;
	name="*";
	last="*";
	major="*";

}
void studentType::print()
{

}
void courseType::set(int c,string t,int cr)

{
	code=c;
	title=t;
	credit=cr;
	for(int i=0;i<=15;i++)
  infile>>code>title>>credit;

}
void courseType::set(int c,string t,int cr)
{
	c=code;
	t=title;
	cr=credit;
}
courseType::courseType()
{

code=0;
	title="*";
	credit=0;
}
 recordType::recordType(int i,int c,double t,string g,int s)
{
	id=i;
	code=c;
	total=t;
	grade=g;
	semster=s;
}
void courseType::print()
{
	id=id[0];
	for(int i=0;i<=15;i++)
	{
	if(id==id)
  cout<<id<<code<<total<<grade<<semester;

	}
}
void recordType::set(int i,int c,double t,string g,int s)
{
	id=i;
	code=c;
	total=t;
	grade=g;
	semster=s;

for(int i=0;i<=15;i++)
  infile>>id>>code>>total>>semster;
}
void recordType::get(int i,int c,double t,string g,int s)
{


i=id;
c=	code;
t=	total;
g=	grade;
s=	semster;
}
recordType::recordType(int i,int c,double t,string g,int s)
{
id=i;
	code=c;
	total=t;
	grade=g;
	semster=s;
}
void recordType::gpa()
{
	total=0;
	id=id[0];
	for(int i=0;i<=15;i++)
	{
	if(id==id)
  total+=total;
     a=3i;
  return ((total/a)*100);
  
	}

}
void recordType::print()
{
	code=code[0]

for(int i=0;i<=15;i++)
{
	cout<<id<<endl;
	if(code==code)
  cout<<id;

}
voidrecordType:: highmark()
{
	max=grade
  int index=0;
  for(int i=0;i<=15;i++)
  {
  	if(grade>max)
    max=grade;
  	i=index;
  }
  cout<<"the highest score is"<<id[index]<<"and the score is"<<max<<endl;

}

#include<iostram>

#include<string>

#include <fstream>

#include "studntType"

using namespace std;

int main

{

int x;

string y,z,w;

studentType ob1[15];

courseType ob2[15];

recordType ob3[15];

ifstream infile("txt.txt",ios::in);

ifstream infile ("txt1.txt",ios::in);

ifstram infile("txt2.txt,ios::in);

ob1[].set( i, n, l, m);

ob1[].get(i,n,l,m);

{

return 0;

}

txt1.txt

txt2.txt

txt.txt

()

تم تعديل هذه المشاركة بواسطة bebe في 17 أكتوبر 2005 في 22:49

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

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