標題:
[作業] 購物系統 (一)
[打印本頁]
作者:
tonyh
時間:
2015-3-7 11:21
標題:
[作業] 購物系統 (一)
本帖最後由 tonyh 於 2015-3-14 10:45 編輯
運用陣列技巧, 設計一購物系統的商品價目表,
商店名稱
與
商品名稱
請同學們發揮創意自由發揮.
[attach]1160[/attach]
#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;
}
複製代碼
作者:
李知易
時間:
2015-3-7 12:06
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[5]={"砍頭優惠卷","特效搖頭丸","自殺體驗卷","被打免費票","舒柔鼻涕蟲"};
int price[5]={99111,458645,14000,99999,100000};
cout<<"****壞掉玩具店****"<<endl;
cout<<"<商品價目表>"<<endl;
cout<<"========================="<<endl;
for(int i=0; i<5; i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
洪振庭
時間:
2015-3-7 16:12
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[7]={"速效跳課糖","米你毛毛球","無頭帽","金斯雀奶油","攜帶型沼澤","假魔杖","伸縮耳"};
int price[7]={90,150,74,3,80,1,4};
cout<<"****衛氏巫師法寶店****"<<endl;
cout<<"<=商品價目表=>"<<endl;
for(int i=0; i<7; i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"金加隆"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
謝瀞儀
時間:
2015-3-7 16:17
本帖最後由 謝瀞儀 於 2015-3-14 10:59 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[21]={"V家七宗罪系列(包含序號2~9)","湯匙(齒輪) ",
"酒杯 ",
"劍 ",
"金鑰匙 ",
"人偶 ",
"四面鏡 ",
"禍世之剪 ",
"上了發條的搖籃曲 ",
"白癡藥水 ",
"生鏽的齒輪人偶 ","染血雙刃(附皮革套) ",
"跳針的古老大鐘 ","失憶藥丸 ",
"座敷童子的靈棺 ","淌血的附喪神人偶 ",
"會咬人的蜘蛛玩偶 ",
"梅杜莎的頭顱 ","巫婆熬藥的大鍋 ",
"活生生殭屍殺人魔/吸血鬼 "};
long money[20]={1200,70,80,80,100,120,150,100,350,
70,50,20,130,70,130,120,250,500,10000};
cout<<"XXX崩壞/中二玩具精品店XXX"<<endl;
cout<<"這裡的壞掉商品包山包海,應有盡有,等你來搜刮!"<<endl;
cout<<"對於購買商品的問題,出什麼事本店一概不負責"<<endl;
cout<<"------------------------------------------"<<endl;
int i=0;
while(i<19)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<money[i]<<"萬元"<<endl;
i++;
}
system("pause");
return 0;
}
複製代碼
作者:
梁和雋
時間:
2015-3-14 10:51
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[5]={"CAD ","NERvGear","蘿球 ","密斯提斯","吉太 "};
int price[5]={10000,20000,20000,10000,10000};
cout<<"****動漫道具店****"<<endl;
cout<<"商品價目表"<<endl;
cout<<"========================="<<endl;
for(int i=0; i<5; i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
李大全
時間:
2015-4-9 19:56
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string n[3]={"CAD呵 ","NERvGearㄛ",吉太 喔 "};
int p[3]={10000,22222222222222222222222222222222222222222222,20000000};
cout<<"***動漫商品店***"<<endl;
cout<<"商品價目表"<<endl;
cout<<"+=+=+=+=+=+=+"<<endl;
for(int i=0; i<3; i++)
{
cout<<"("<<i+1<<")"<<n[i]<<"\t"<<p[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2