標題:
購物系統 (一)
[打印本頁]
作者:
tonyh
時間:
2014-1-25 17:21
標題:
購物系統 (一)
本帖最後由 tonyh 於 2014-1-25 18:04 編輯
運用陣列技巧, 設計一購物系統的商品價目表, 商店名與商品請同學們發揮創意自由發揮.
[attach]828[/attach]
本帖隱藏的內容需要回復才可以瀏覽
作者:
張郁偵
時間:
2014-1-25 18:05
#include<iostream>
#include<cstdlib>
using namespace std;
int main ()
{
cout<<"∮∮∮愛心甜點店店∮∮∮"<<endl;
cout<<"~商品價目表~"<<endl;
string n[5]={"卡布奇諾 ","濃郁黑咖啡 ","焦糖瑪奇朵 ","黑森林蛋糕 ","原味起司蛋糕 "};
int p[5]={160,210,125,95,65};
for(int i=0; i<=4; i++)
{
cout<<"("<<i+1<<")"<<" "<<n[i]<<" "<<p[i]<<endl;
}
system ("pause");
return 0;
}
複製代碼
作者:
張峻瑋
時間:
2014-1-25 18:08
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[7]={"遙控飛機","水槍 ","玩偶 ","足球 ","拼圖 ","籃球 ","玩具車"};
int price[7]={50000,6500000,70000,655000,999999,300000,750000};
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;
}
複製代碼
作者:
周雍程
時間:
2014-1-25 18:08
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
cout<<"*** special植物專賣店 ***"<<endl<<endl;
string name[7]={"黃金玫瑰","食人花",
"幽靈草","瘋樹 ",
"魔鬼藤蔓","含兇草",
"搖頭樹"};
int price[7]={7099,1598,2960,1800,4050,3999,6540};
for(int i=0; i<=6; i++)
{
cout<<"<"<<i+1<<">"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
張彥承
時間:
2014-1-25 18:10
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
cout<<"***Legend's Sports Store***"<<endl;
cout<<"The Price LIST"<<endl;
string name[7]={"Rose4 ",
"NIKE Ambassader",
"JORDAN FLIGHT",
"ADIfast ",
"adizero crazy light",
"NIKE hyperdunk 2013",
"ADIZERO CRAZY QUICK"};
int price[7]={4500,
3950,
2400,
2780,
2950,
2495,
2154};
for(int i=0;i<=6;i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
張郁庭
時間:
2014-1-25 18:11
#include<iostream>
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name [6]={"冬瓜茶","蘋果冰沙","檸檬愛玉","珍珠奶茶","阿華田","多多綠茶"};
string price [6]={"20","30","25","25","25","25"};
cout<<"=====超級飲料店====="<<endl;
cout<<"[飲料價目表]"<<endl;
for(int i=0; i<=5; i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
}
system ("pause");
return 0;
}
複製代碼
作者:
劉得旗
時間:
2014-2-8 17:21
#include<iostream>
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name [6]={"青茶","水果茶","檸檬水","奶茶","水","綠茶"};
string price [6]={"15","20","15","25","10","20"};
cout<<"多喝水飲料店"<<endl;
cout<<"[飲料價目表]"<<endl;
for(int i=0; i<=5; i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
}
system ("pause");
return 0;
}
複製代碼
作者:
施伯叡
時間:
2014-2-14 20:33
#include<iostream>
#include<cstdlib>
using namespace std;
int main ()
{
cout<<"~~~超酷球店~~~"<<endl<<endl;
cout<<"(商品價目表)"<<endl;
string name[5]={"乒乓球",
"棒球 ",
"足球 ",
"躲避球",
"籃球 "};
int money[5]={50,100,125,200,600};
for(int i=0; i<=4; i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<money[i]<<"元"<<endl;
}
system ("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2