課程設計錯誤
1. c語言課設程序 代碼沒有錯誤 運行時提示文件打開出錯
如果代碼沒錯,那就是文件路徑不對,或者文件不存在。先確認下文件路徑吧
2. 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("沒有查詢到可刪除數據!");
}
}
編譯是沒有問題了,但是你的程序還缺少東西,比如事先存儲好的數據等,自己再改改吧,這個東西不難,最好自己寫,你懂得。。。。
3. C語言課程設計的錯誤
goto end;
end://不要分號吧
fclose(fp);//前面的(fp=fopen("stud.txt","r"))==NULL成立就會跳到這里來,那就是fclose(NULL);這樣不行吧
4. 課程設計打不開,office 2010提示無法打開XXX,因為內容有錯誤。元素結束標記中的名稱必須與開始標記
點開控制面板---卸載---找到office2010程序---更改---修復
5. 關於軟體工程課程設計(java語言)源代碼出錯的問題
朋友你好,
由於你沒有源代碼的提供所以我只能給你大致聊一下關於你編譯時報出的錯誤都出現在什麼地方。
主要是在新的JDK中,你使用的方法已經認為存在一些BUG或者已經被其它函數替代,為了保持兼容,新版本的JDK依然保留函數名,並且加上了標簽:@Deprecated ,這表明這個函數已經不再使用,後面的更新版本可能會不再支持這個函數了。
而你後面報錯找不到main方法也是由於前面的錯誤而引發的。如果朋友你使用java的編程軟體eclipse,將能夠看到你調用的某個方法是被中斜杠劃掉了。建議朋友你在myeclipse下編譯允許java程序,能夠得到更多的提示,便於自己的調試等。
具體的解決辦法: :
1 使用舊的JDK,卸載目前的JDK,找舊的JDK安裝
2 使用新的函數重寫,重寫即是在類中繼承這個介面,重新定義其這個方法內的內容。
平時盡量是技術問題的話多上谷歌,希望能夠對你有所幫助。
6. 最近在弄課程設計,程序是從網上抄的,但是還有錯誤,求哪位大神告訴我這是哪錯了
沒有那個頭文件,所以報警。下面兩個應該是在頭文件裡面的,沒有頭文件,就找不到那個參數的定義。
7. 做java課程設計(代碼較長,我不好發),編譯是沒錯誤,但運行時就出現了按任意鍵繼續,這是怎麼回事
你這樣描述 別人沒辦法幫你的
8. c++課程設計一般都會出現哪些錯誤,錯誤提示都是什麼
拼寫的錯誤,這是一些基本的問題,關鍵字的拼寫錯誤。形參沒有定義,這個要看清形參作用域格式錯誤,這個在編寫類時,例如提前調用其他函數成員時,沒有聲明。無返回值,在主調函數中,聲明是int 或是其他類型是(除了void)要求有一個返回值。在同一作用域中重復聲明形參,同類型同名稱的形參。關鍵字的聲明格式要注意用大小寫字母,數字和_組成
9. C語言課程設計代碼有錯,不知道怎麼改,求助。
/*你這里有兩個錯誤:
第一個:把showmessage函數前的void去掉
第二個:fwirte寫錯了,正確的應該是fwrite
我把你的程序改了一下,正確運行出來了*/
#include<stdio.h>
#include<stdlib.h>
#defineSIZE1000
structstudent_type
{
intnum;
charname[10];
intgrade;
}student[SIZE];
voidsave()
{
FILE*file;
inti;
if((file=fopen("Student'slist","r"))==NULL)
{
printf("Cannotopenthisfile. ");
return;
}
for(i=0;i<SIZE;i++)
if(fwrite(&student,sizeof(structstudent_type),1,file)!=1)
printf("Filewirteerror. ");
fclose(file);
}
voidReceiveInformation()
{
printf("學號姓名C語言成績 ");
scanf("%d%s%d",&student[SIZE].num,student[SIZE].name,&student[SIZE].grade);
save();
showmessage();
}
voidrrrr()
{
FILE*file;
file=fopen("Student'slist","rb");
while(fread(&student,sizeof(structstudent_type),1,file)==1)
{
fread(&student,sizeof(structstudent_type),1,file);
printf("%4d%-10s%4d ",student[SIZE].num,student[SIZE].name,student[SIZE].grade);
}
fclose(file);
}
showmessage()
{
inti;
intnum;
printf("請選擇操作類型: ");
printf("增加同學輸入1 ");
printf("刪除同學輸入2 ");
printf("查找同學輸入3 ");
printf("顯示所有同學信息輸入4: ");
scanf("%d",&num);
if(num==1)
{
ReceiveInformation();/*函數調用完成錄入一個同學*/
}
elseif(num==2)
{
/*函數調用完成刪除一個同學*/
}
elseif(num==3)
{
/*函數調用完成查找一個同學*/
}
elseif(num==4)
{
rrrr();/*函數調用完成顯示所有同學信息*/
}
else
{
printf("輸入錯誤");
exit(0);
}
}
voidmain()
{
printf("學生成績管理系統 ");
showmessage();
}