標題:
購物系統 (一)
[打印本頁]
作者:
tonyh
時間:
2020-12-5 19:52
標題:
購物系統 (一)
運用陣列技巧,設計一購物系統的商品價目表,
商店名稱
與
商品價格
請同學們發揮創意自由發揮。
提示:宣告兩個一維陣列,分別裝商品名稱與商品價格。
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","可愛玩偶","籃球 "};
int price[]={450,550,325,200,660,150,380};
cout<<"☆★☆智能玩具店☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
余柏緯
時間:
2020-12-5 19:59
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","可愛玩偶","籃球 "};
int price[]={450,550,325,200,660,150,380};
cout<<"☆★☆智能玩具店☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
李柏穎
時間:
2020-12-5 20:00
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[7]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","可愛玩偶","籃球 "};
int price[7]={450,550,325,200,660,150,380};
cout<<"☆★☆智能玩具店☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
王宇崴
時間:
2020-12-5 20:01
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"汽車模型","飛機模型","足球模型","拼圖模型","槍槍模型 ","可愛玩偶","籃球 "};
int price[]={444444,5555555,3333333,200,660,150,380};
cout<<"☆★☆智能玩具店☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
朱奕祐
時間:
2020-12-5 20:01
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","可愛玩偶","籃球 "};
int price[]={450,550,325,200,660,150,380};
cout<<"☆★☆智能玩具店☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
黃子倢
時間:
2020-12-5 20:04
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string n[5]={"玩具車","熊玩偶","羽毛球","乒乓球","玩具槍"};
int p[5]={450,300,30,10,600};
cout<<"☆智能玩具店☆"<<endl<<endl;
cout<<"商品價目表"<<endl<<endl;
for(int i=0; i<5; i++)
{
cout<<"("<<i+1<<")"<<n[i]<<"\t"<<p[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
俞成章
時間:
2020-12-5 20:04
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"汽車","飛機","足球原子彈 ","笑氣球 ","狙擊槍 ","可愛玩偶炸彈","籃球手榴彈 "};
int price[]={860,750,325,890,660,140,580};
cout<<"☆★☆智能軍武店☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
林鼎傑
時間:
2020-12-5 20:07
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"黃色飛機 ","金正恩模型","笑氣 ","智障遊戲","手槍 ","充氣玩偶","籃鳥 ","核彈 ","雄商飛彈"};
int price[]={1233,666,325,999,2150,2999,799,95000000,49999999};
cout<<"☆★☆畸形軍火庫☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<9; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
王首二
時間:
2020-12-5 20:12
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"手榴彈","F36 ","核彈 ","RPG ","廢物 "};
int price[]={450,550,325,200,660};
cout<<"☆★☆智能軍火店☆★☆"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<5; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
許洧熏
時間:
2020-12-5 20:15
本帖最後由 許洧熏 於 2020-12-5 20:23 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"飛機","特斯拉","法拉利 ","遊覽車 ","公車 ","嘿嘿車","電動玩具車 "};
int price[]={850,250,925,660,150,380};
cout<<"☆★☆玩具店☆★☆"<<endl<<endl;
cout<<"[商品價格表]"<<endl;
for(int i=0; i<6; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
呂尚霖
時間:
2020-12-5 20:18
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"火箭炮彈","防護盾槍","核彈 ","手槍 ","特斯拉 ","警察手銬","步槍 "};
int price[]={5000,59487,999999,1,660000,15,8787};
cout<<"危險玩具店(嘿嘿)"<<endl<<endl;
cout<<"[恐怖價目]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
王秉鈞
時間:
2020-12-5 20:25
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[6]={"雪莉(玩偶)","黑雞 鐵鏟 氫氣氣球","炸彈 ","鉛筆模型 ","明太子(炸彈) ","史派克 "};
int price[6]={0,658,95110,45454,78945,9214};
cout<<"史派克丸劇墊"<<endl<<endl;
cout<<"[商品架木表]"<<endl;
for(int i=0;i<7;i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2