標題:
[作業] 購物系統 (一)
[打印本頁]
作者:
方浩葦
時間:
2024-7-13 09: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;
}
複製代碼
作者:
林少謙
時間:
2024-7-13 15:07
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string a[]{"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","可愛玩偶","籃球 "};
int b[]={450,550,325,200,660,150,380};
cout<<"☆★☆智能玩具店☆★☆"<<endl<<endl;
cout<<"商品價目表"<<endl;
for(int i=0; i<7; i++)
{
cout<<"<"<<i+1<<">"<<a[i]<<"\t"<<b[i]<<"元"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
李唯銘
時間:
2024-7-13 15:17
#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;
}
複製代碼
作者:
劉奕劭
時間:
2024-7-13 15:27
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string a[7]={"遙控汽車","飛機模型","足球/t","拼圖/t","玩具槍","可愛玩偶","籃球/t"};
int b[7]={450,550,325,200,660,150,380};
cout<<"玩具店"<<endl<<endl;
cout<<"[價目表]"<<endl;
for(int i=0; i<7; i++)
cout<<"("<<i+1<<")"<<a[i]<<"\t"<<b[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
洪榮辰
時間:
2024-7-14 11:26
#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;
}
複製代碼
作者:
高湘庭
時間:
2024-7-14 17: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;}
cout<<"<8>"<<"結帳"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
陳妍蓁
時間:
2024-7-19 22:19
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
cout<<"***智能玩具店***"<<endl<<endl;
cout<<"[商品價目表]"<<endl;
string n[7]={"遙控汽車","飛機模型","足球 ","拼圖 ","玩具槍 ","玩偶 ","籃球 "};
int p[7]={450,550,325,200,660,150,380};
for(int i=0;i<7;i++)
cout<<"("<<i+1<<")"<<n[i]<<"\t"<<p[i]<<"元"<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2