c語言課程設計宿舍
❶ 課程設計用C語言做一個學生寢室安排系統,一個地方不懂
首先你要分析,床位和學生本人是關聯的,那學生信息結構體中就要有這版個成員。
其次權,寢室會有很多個,你可以創建一個寢室的結構體,STRU_ROOM,比如,男生寢室有10個寢室,女生寢室有5個寢室,那麼:
typedef struct boy_building
{
STRU_ROOM ROOM1;
.........
STRU_ROOM ROOM10;
}BOY_BUILDING;
typedef struct girl_building
{
STRU_ROOM ROOM1;
.........
STRU_ROOM ROOM5;
}GIRL_BUILDING;
值描述一個意思,語法什麼的自己注意一下吧
STRU_ROOM 中可以包括這個寢室是幾人寢,都是誰住,剩餘幾個床位(住進一個人後這個變數--),可以使用全局變數、數組存儲(既然不讓用資料庫……)。
❷ 求大神幫忙:c語言課程設計:學生宿舍管理系統
這還不簡單?就一個簡單那的資料庫啦,關系也比較明確,做一個圖了解一下思路,很簡單,自己動手吧,不懂就問同學,對你有幫助。。。。
❸ c語言課程設計宿舍管理系統,我寫的老有錯誤,請大神幫忙修改一下,好的加分
#include<stdio.h>
#include<string.h>
#define MaxSize 6
struct student_info
{ char name[8];
int sum;
char intime;
char outime;
int number;
int studentroom;
}StudentList[MaxSize];
int Insert(int*a);
void Update(int);//這少了個分號
void Delete(int*a);
int main()
{int i;
int count=0;
do
{printf("\n");
printf("1.插入(Insert)\n");
printf("2.修改(Update)\n");
printf("3.刪除(Delete)\n");
printf("4.退出(Eixt)\n");
scanf("%d",&i);
switch(i)
{case 1:Insert(&count);break;
case 2:Update(count);break;
case 3:Delete(&count);break;
case 4:break;
default:printf("輸入錯誤,請重新輸入!");break;}
}
while(i!=6);
return 0;
}
int Insert(int*count)
{
int i,in_number;
if(*count==MaxSize)
{printf("空間已滿!");
return 0;}
printf("請輸入編號:");
scanf("%d",&in_number);
for(i=0;i<*count;i++)
if(StudentList[i].number==in_number)
{printf("已經有相同的編號:"); //這的分號是中文符號
return 0;}//return沒有返回值
StudentList[i].number=in_number;//應該是.number你打成了,number
printf("請輸入學生姓名:");
scanf("%s",StudentList[i].name);//看到這我覺得你的程序是的吧,以前是個Guest。。。。。
printf("請輸入學號:");
scanf("%d",StudentList[i].number);//
printf("請輸入房間號:");
scanf("%d",StudentList[i].studentroom);
printf("請輸入入住日期:");
scanf("%s",StudentList[i].intime);
printf("請輸入離開日期:");
scanf("%s",StudentList[i].outime); //這里outime打錯了!
(*count)++;
return 0;
}
void Search(int count)
{int i,number,flag=1;
printf("請輸入要查詢的編號:");
scanf("%d",&number);
for(i=0;i<count&&flag;i++)
if(StudentList[i].number==number)
{printf("姓名:%s",StudentList[i].name);
printf("學號:%d",StudentList[i].number);
printf("房間號:%d",StudentList[i].studentroom);
printf("入住日期:%s",StudentList[i].intime);
printf("離開日期:%s",StudentList[i].outime);
flag=0;}
else
printf("沒有查詢到!");}//這里少了個分號
void Update(int count)
{ int i,number,flag=1;
printf("請輸入要修改數據的編號:");
scanf("%d",&number);
for(i=0;i,count&&flag;i++)
if(StudentList[i].number==number)
{printf("請輸入學生姓名:");
scanf("%s",StudentList[i].name);
printf("請輸入學號:");
scanf("%d",StudentList[i].number);
printf("請輸入房間號:");
scanf("%d",StudentList[i].studentroom);
printf("請輸入入住日期:");
scanf("%s",StudentList[i].intime);
printf("請輸入離開日期:");
scanf("%s",StudentList[i].outime);
flag=0;
}
else
printf("未查詢到可供修改數據!");
}
void Delete(int*count)
{int i,j,number,flag=1;
printf("請輸入要刪除數據編號:");
scanf("%d",&number);
for(i=0;i<*count&&flag;i++)
{
if(StudentList[i].number==number) {
for(j=i;j<*count-1;j++)
StudentList[j]=StudentList[j+1];
flag=0;
(*count)--;
}
else
printf("沒有查詢到可刪除數據!");
}
}
編譯是沒有問題了,但是你的程序還缺少東西,比如事先存儲好的數據等,自己再改改吧,這個東西不難,最好自己寫,你懂得。。。。
❹ C語言課程設計
貌似要動用很多腦力
貌似分數不夠
不是不幫你
是工作沒時間
留給別人吧
❺ 學生宿舍管理 (一)、內容: 請用C語言為宿舍管理人員編寫一個宿舍管理軟體.
基本上就是這樣了。。。只有輸出輸入用了c++的cout/cin你可以自己換成printf和scanf,很簡單的。。
程序在vc下運行了。
#include<iostream.h>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
struct student{
char ID[10];//學號
int BN;//床號
char RN[10];//宿舍號
char NAME[10];//姓名
student *next;
};
typedef student stu;
stu* Head;
int menu()//用戶選擇的菜單
{
cout<<"1:查看學生信息"<<endl;
cout<<"2按學號排序:"<<endl;
cout<<"3:查看宿舍的人員信息"<<endl;
cout<<"0:退出系統"<<endl;
cout<<"請選擇"<<":";
char c;
int ch;
int flag=1;
while(flag)
{
cin>>c;
ch=(int)c-48;
if(ch>=0&&ch<=3)
flag=0;
else
cout<<"輸入錯誤,請重新輸入:";
}
return ch;
}
void sort(stu *head)//冒泡排序
{ int time=0;
char id[10];
int bn;
char rn[10];
char name[10];
stu* temp=head;
while(temp->next!=NULL)
{
temp=temp->next;
time++;
}
temp=head;
int i,j,last;
i=time-1;while(i>0){
for(j=0;j<i;j++)
{
if(temp->BN>temp->next->BN)
{
strcpy(id,temp->ID);
strcpy(rn,temp->RN);
strcpy(name,temp->NAME);
bn=temp->BN;
strcpy(temp->ID,temp->next->ID);
strcpy(temp->RN,temp->next->RN);
strcpy(temp->NAME,temp->next->NAME);
temp->BN=temp->next->BN;
strcpy(temp->next->ID,temp->ID);
strcpy(temp->next->RN,temp->RN);
strcpy(temp->next->NAME,temp->NAME);
temp->next->BN=temp->BN;
last=j;
}
i=last;
}
}
cout<<"排序成功!!!"<<endl;
}
void List(stu *head) // 列印所有學生信息
{
stu *p;
p=head;
if(p==NULL)
cout<<"記錄為空"<<endl;
else
{ cout<<"記錄如下:"<<endl;
while(p!=NULL){
cout<<p->ID<<" "<<p->BN<<" "<<p->RN<<" "<<p->NAME<<endl;
p=p->next;
}
}
}
stu *InputNewRecord(stu *node)//輸入新加成員的信息
{
cout<<"Input ID\n";
cin>>node->ID;
cout<<"Input BN\n";
cin>>node->BN;
cout<<"Input RN\n";
cin>>node->RN;
cout<<"Input NAME\n";
cin>>node->NAME;
return node;
}
int OkOrNot(char *name)
{
char c;
cout<<"請確認想進行此項操作(是請按y或者Y)";
cin>>c;
if(c=='y'||c=='Y')
return 1;
else
return 0;
}
void AppendNode(stu *head)/*在鏈表的末尾添加新的節點*/
{
stu *p,*newnode,*last;
if(!OkOrNot("Append")) return;
last=head;
p=head->next;
while(p!=NULL)
{
last=p;
p=p->next;
}
newnode=(stu*)malloc(sizeof(stu));
newnode->next=NULL;
p=InputNewRecord(newnode);
last->next=p;
}
void ShowRD(stu *head)//查找某宿舍的學生信息
{
stu *p=head;
int flag=1;
cout<<"輸入你要查看的房間號:"<<endl;
char tp[10];
gets(tp);
for(;p!=NULL;p=p->next)
{
if(strcmp(p->RN,tp)==0)//找到並列印
{
cout<<p->ID<<"**"<<p->BN<<"**"<<p->RN<<"**"<<p->NAME<<endl;
flag=0;
}
}
if(flag)
}
int main()
{
stu a=;
stu *head;
head=&a;
head->next=NULL;
Head=head;
cout<<" 歡迎進入宿舍信息管理系統 "<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "<<endl;
begin: AppendNode( Head);
cout<<"還要輸嗎?"<<endl;
char k;
cin>>k;
if(k=='Y'||k=='y')
goto begin;
int f3=1;
while(f3)
{
switch(menu())
{
case 1:
List(Head);
break;
case 2:
sort(Head);
break;
case 3:
ShowRD(Head);
break;
case 0:
f3=0;
break;
}
}
return 0;
}
❻ c語言課程設計
學生成績管理系統網上有很多 下載後改改就能用
❼ c語言課程設計——宿舍信息管理系統
你才懸賞15分?這么不捨得,我懸賞了100分才有個人願意寫一點,你那個要到網路裡面去弄,我看到有人問了,應該可以找到的,死東西!
❽ C語言課程設計題目.某單位擬分配一批福利房,該福利房共有1000套.已知文本文件f1.txt中存放了該單位員工
c語言課程設計 福利房問題幫實現
❾ C語言課程設計:房間布置
你好!!!
這個設計不同於什麼成績管理設計,人事管理設計,圖書館管理設計、、、、它不僅需要很強的編程能力,還得要windows的知識吧,那麼做出來的軟體才可以,但是說實話,你在這里提問沒有會幫你編程的,1.分那麼少,2.光寫代碼至少一個小時,最讓人頭痛的就是調試,很煩人的,因此建議自己換一個課程設計,或是提高懸賞分看看,、、、、、分一定要高,
俺編了好長時間的程序,我也是頭一次遇到設計房間的代碼,我也頭痛!!!,不好意思不能幫上忙!!!
❿ 求一個C語言程序,要求用Windows窗口 現學校要管理宿舍入住的學生,請設計一宿舍管理程序,以方
不算復雜,但也不簡單,誰會這么傻,就為50積分?值一毛錢?