50分★★★急急急!!!C++语言问题,高手进!!!

来源:百度知道 编辑:UC知道 时间:2024/06/01 20:31:17
帮帮我写这个程序,tnx!
大家不用做到太腹杂,简简单单就好。
#include <fstream>
#include <iostream.h>
#include <string.h>
#include<stdio.h>
#inlucde <math.h>
#define SIZE
这些都读过,应该可以完成吧,不要用太高级的头文件。
(还有放解说让我知道)

题目如下:

Enhancemant of Grade Calculation Program.
1. Implement array to accept N number of student.
2. Implement Function affectively to manage the source code.
3. Implement structures to manage records.
4. Provide option to either print the result on the sreen on save into a file.
5. Formatted output is expected

SAMPLE STORE
student_id, student_Name, gender, program
j07003408, lin jun jie , male , marketing
j08003478, lin yu chung, female, engineering

(翻译大概是这样,如有错误以英文为准)
设计计算程序。
1 。实现数组储存学生
2 。实现函数管理模块化
3 。实现数据结构来管理记录。(链表)
4 。提供两种选项,打印的结果保存到文件中。
5 。格式化输出

这个题有好几个人在问了,下面是我给其他人的回答,结构体的数据成员只有三个,少了 姓名 这一项,你自己加上去吧

#include <fstream>
#include <iostream>
#include <string>
using namespace std;

struct student
{
unsigned int stu_ID;
char sex;
int age;
struct student *st;
};

struct student *p,*h,*s;
student* create_list(){//建立链表,返回链表的头结点
int i=20;
p = new student;
h = p;
p->stu_ID=1000;
p->sex = 'M';
p->age = i;
do{
s=new student;
s->stu_ID=i+1000;
s->sex = 'M';
s->age = i;
p->st = s;
p = s;
i++;
}while(i<31);
p->st = NULL;
return h;
}

bool add_node_at_end(student* h,student* node_to_add){
//传入头结点和要添加的结点
if(h){
student* temp=h;
while(temp->st)
temp=temp->st;//找到链表的最后一个结点,跳了循环
node_to_add->st=NULL;