標題:
購物系統 (一)
[打印本頁]
作者:
王瑞喻
時間:
2019-9-27 16:06
標題:
購物系統 (一)
本帖最後由 王瑞喻 於 2019-10-12 09:28 編輯
運用陣列技巧, 設計一購物系統的商品價目表, 商店名稱與商品價格請同學們發揮創意自由發揮.
提示: 宣告兩個一維陣列, 分別裝商品名稱與商品價格.
[attach]7214[/attach]
#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;
}
複製代碼
作者:
洪子涵
時間:
2019-9-28 11:00
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string n[7]={"車","飛機","足球","拼圖","槍","玩偶","籃球"};
int m[7]={100,150,200,250,300,350,400};
cout<<"@@@@玩具店@@@@"<<endl<<endl<<"$$$價目表$$$"<<endl;
for(int i=0;i<7;i++)
{
cout<<"("<<i+1<<")"<<n[i]<<"\t\t"<<m[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
郭哲維
時間:
2019-9-29 11:52
本帖最後由 郭哲維 於 2019-10-1 19:45 編輯
#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;
}
複製代碼
作者:
鄭羽捷
時間:
2019-10-6 16:09
#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;
}
複製代碼
作者:
洪藜芸
時間:
2019-10-11 20:03
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
cout<<"◎◎◎玩具店◎◎◎"<<endl<<endl<<"[商品價目表]"<<endl;
string p[7][2]={{"遙控汽車","450"},{"飛機模型","550"},{"足球","325"},{"拼圖","200"},{"玩具槍","660"},{"可愛玩偶","150"},{"籃球","380"}};
for(int i=0;i<7;i++)
{
cout<<"〈"<<i+1<<"〉";
for(int a=0;a<1;a++)
cout<<p[i][a]<<"\t";
for(int a=1;a<2;a++)
cout<<p[i][a]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
曾宥程
時間:
2019-10-12 10:59
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","Tony老師","籃球 "};
int price[]={450,550,325,200,660,878,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;
}
複製代碼
作者:
王翎璇
時間:
2019-10-12 11:00
#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;
}
複製代碼
作者:
洪榜蔓
時間:
2019-10-12 11:00
#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;
}
複製代碼
作者:
陳宇柏
時間:
2019-10-12 11:05
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[5]={"法拉利","藍寶傑尼","特斯拉","賓士","BMW"};
int a[5]={400,350,250,150,125};
cout<<"***跑車專賣***"<<endl<<endl;
cout<<"[價目表]"<<endl;
for(int i=0; i<4; i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<a[i]<<"萬元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
黃傳耀
時間:
2019-10-12 11:06
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"阿法狗","深藍 ","絕藝 ","里拉 ","ZenGO ","LGS ","手談 "};
int price[]={8700,3800,7800,2000,6600,1500,5900};
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;
}
複製代碼
作者:
蔡少宇
時間:
2019-10-12 11: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;
}
複製代碼
作者:
王建葦
時間:
2019-10-12 11:13
本帖最後由 王建葦 於 2019-10-18 19:08 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name[]={"Millet "
,"SONY "
,"Samsung "
,"OPPO "
,"APPLE "
,"Koreafish "
,"ASUS "
,"VegetablesEnglish"};
int m[]={9000,7000,7000,8000,50000,0,9000,0};
cout<<"=====不知道賣什麼的專賣店====="<<endl;
cout<<"[商品價目表]"<<endl;
for(int i=0;i<=7;i++)
{
cout<<"("<<i+1<<")"<<name[i]<<"\t"<<m[i]<<"元"<<endl;
}
cout<<"總金額: "<<sum<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
林孟蓁
時間:
2019-10-19 10:40
#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;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2