標題:
購物系統 (一)
[打印本頁]
作者:
tonyh
時間:
2022-12-31 14:48
標題:
購物系統 (一)
運用陣列技巧,設計一購物系統的商品價目表,
商店名稱
與
商品價格
請同學們發揮創意自由發揮。
提示:宣告兩個一維陣列,分別裝商品名稱與商品價格。
#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;
}
複製代碼
作者:
羅紹齊
時間:
2022-12-31 15:06
#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;
}
複製代碼
作者:
林雋喆
時間:
2022-12-31 15:06
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"AR15 ","M4 ","scored M4 ","98K ","AMP ","AK47 ","RPG "};
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;
}
複製代碼
作者:
吳俊頡
時間:
2022-12-31 15:08
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
string n[]={"手榴彈","狙擊槍","火箭筒","AK47 ","散彈槍"};
int price[]={450,550,325,200,660,150};
cout<<"武器店"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<n[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
翁川祐
時間:
2022-12-31 15:08
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string i[]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","可愛玩偶","籃球 "};
int j[]={450,550,325,200,660,150,380};
cout<<"--玩具店--"<<endl;
for(int k=0;k<=6;k++){
cout<<"("<<k+1<<")"<<i[k]<<"\t"<<j[k]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
陳牧謙
時間:
2022-12-31 15:08
#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;
}
複製代碼
作者:
葉佳和
時間:
2022-12-31 15:09
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"沙德威斯坦","蟑螂屍體","萊柏屬塾大狙","加八十攝影","阿帕茶","破甲箭","地下水"};
int price[]={10000,10,500,540,0,9999,50};
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;
}
複製代碼
作者:
宜儒
時間:
2022-12-31 15:09
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
string name[]={"怪味豆 ","巧克力青蛙 ","故障的隱形斗篷 ","變身藥水 ","反彈魔杖 "};
int price[]={30,50,350,500,650};
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;
}
複製代碼
作者:
陳宥霖
時間:
2022-12-31 15:10
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"遙控車","飛機模型","籃球 ","101拼圖 ","遊戲機 ","可愛玩偶","棒球 "};
int price[]={90,70,30,60,80,50,20};
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;
}
複製代碼
作者:
盧禹丞
時間:
2022-12-31 15:11
#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<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
徐啟祐
時間:
2022-12-31 15:11
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
string name[]={"遙控車","飛機模型","足球 ","拼圖 ","玩具槍 ","食用玩偶","籃球 "};
int price[]={750,330,325,200,160,450,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;
}
複製代碼
作者:
羅暐傑
時間:
2023-1-6 21:50
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
string name[]={"手機 ","電腦 ","智慧型手錶","藍牙耳機","耳罩式耳機","折疊手機","電腦顯示器"};
int price[]={450,3000,325,200,660,1200,380};
cout<<"電子產品店"<<endl<<endl;
cout<<"商品價目表:"<<endl;
for(int i=0; i<7; i++) {
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"$USD"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
楊芊琦
時間:
2023-1-13 21:41
#include<cstdlib>
#include<iostream>
using namespace std;
int main()
{
string protuct[] = { "傳說對決","英雄聯盟","寶可夢集結","寶寶巴士","阿嬤跑酷" };
int price[] = { 2000,1000,500,500,1000 };
cout << "--------------遊戲儲值代儲--------------" << endl;
cout << "商品價目表:" << endl;
for (int i = 0;i <= 4;i++)
{
cout << i + 1 << "號商品 ";
cout << protuct[i] << " " << price[i] << "元" << endl;;
}
system("pause");
return 0;
}
複製代碼
作者:
黃品禎
時間:
2023-5-17 18:20
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","可愛玩偶","籃球\t"};
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;
}
複製代碼
作者:
朱奕祈
時間:
2024-1-29 17:08
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[6]={"外星槍","手槍 ","野牛衝鋒槍","火焰噴射器","湯瑪遜衝鋒槍","大砲 "};
int money[6]={450,120,300,540,430,700};
cout<<"☆★☆智能槍具店☆★☆"<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0;i<6;i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<money[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2