今天给各位分享c语言设计POS机刷卡的知识,其中也会对刷卡编程与图形编程进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
- 1、银行POS终端嵌入式开发,用C/C++语言的。需要学习哪些方面知识?请大家给我些好的建议啊
- 2、C语言程序设计题目!!!
- 3、c语言,编写一个售货机(POS)计算程序,用于水果店售货员算账.苹果每千克3.2元,梨每千克1.96元,香
- 4、c语言基础,程序设计
- 5、大学C语言设计程序八币问题
- 6、C语言编写的收银台结算程序。
银行POS终端嵌入式开发,用C/C++语言的。需要学习哪些方面知识?请大家给我些好的建议啊
就是C 语言; 然后是C 语言的开发; POS 这种用到的是嵌入式的开发方式; 你需要把C 彻底理解透; 还有 C 对串口, 磁条刷卡器 这些的打开, 使用, 还有就是 MODEM 通讯, 把数据包发出去, 收回数据包。 POS 打印机的打印, 可能还需要一点加密知识, 和银行卡业务知识。
C语言程序设计题目!!!
#includestdio.h
void main()
{
int buff[10]={1,2,3,4,5,6,7,8,9,10};
int temp;//中间变量
int n;
printf("请输入n的值\n");
scanf("%d",n);
for(int i=0;in;i++)//循环控制移动次数
{
/*移动一位*/
temp=buff[0];
for(int j=0;j10;j++)
buff[j]=buff[j+1];
buff[9]=temp;
}
for(int j=0;j10;j++)
printf("%d ",buff[j]);
}
c语言,编写一个售货机(POS)计算程序,用于水果店售货员算账.苹果每千克3.2元,梨每千克1.96元,香
#include stdio.h
int main(void)
{
float p[4] = {3.2, 1.96, 3, 24};
float w[4] = {1.5, 2, 3, 1.5};
float s = 0;
int i;
for(i=0;i4;i++)
s+= p[i]*w[i];
printf("%s%12s%12s%13s\n", "名称", "单价", "重量", "应付价钱");
printf("---------------------------------------------\n");
printf("%s%12.2f%12.2f%13.3f\n","苹果", p[0], w[0], p[0]*w[0]);
printf("%s%12.2f%12.2f%13.3f\n","梨 ", p[1], w[1], p[1]*w[1]);
printf("%s%12.2f%12.2f%13.3f\n","香蕉", p[2], w[2], p[2]*w[2]);
printf("%s%12.2f%12.2f%13.3f\n","樱桃", p[3], w[3], p[3]*w[3]);
printf("---------------------------------------------\n");
printf("%s%37.2f\n", "总计", s);
printf("%s%37.2f\n", "付款", 100.0);
printf("%s%37.2f\n", "找零", 100.0 - s);
return 0;
}
c语言基础,程序设计
long temp = s;
long dst = 0;
int pos = 0;
while(temp)
{
pos++;
int last = temp%10;
if(pos%2)
{
for(int i = 0; i pos-1; i+=2)
last *=10;
dst += last;
}
temp = (long)temp/10;
}
大学C语言设计程序八币问题
#include stdio.h
int main (void) {
int array[8]={0};
int i=0,pos;
//输入7一个样1个不一样的数标明8个硬币。
while(i8) {
scanf ("%i",array[i]);
i++;
}
//先取两个进行比较
int a=array[0],b=array[1];
if(a!=b) {
if(a!=array[2]) { //第三枚为真币,与之比较
pos=1;
}else{
pos=2;
}
printf ("False Coin is in %i\n",pos);
}else {
for(i=2;i8;i++) { //与剩下的刘枚硬币比较
if(a!=array[i]) {
pos=i+1;
}
}
printf ("False coin is in %i\n",pos);
}
return 0;
}
C语言编写的收银台结算程序。
//以下是参考代码有相似结构,数据结构自己设计一下。
//如果没参考价值,手下留情,别点不采纳。
#define MAXPARKINGPOS 100
#define MAXPRICETYPE 3
#define MAXLINE 4096
struct detail
{
char num[MAXLINE];
char name[MAXLINE];
double pricePerHour;
time_t start;
time_t end;
double period;
double cost;
};
static int currentParkingNum = 0;
static struct detail detailBuf[MAXPARKINGPOS];
static double priceBuf[MAXPRICETYPE] = {11.0,22.0,33.0};
int main(void) {
char buf[MAXLINE];
struct detail *myParking;
int iChoice,leavingIndex,i,numEexisted;
struct tm *begin,*end;
while(true) {
selectService:
printf("Service type,what is your choice?\n1.park\n2.leave\n3.exit\n");
gets(buf);
if(strcmp(buf,"3") == 0) {
return 0;
}
if(strcmp(buf,"1") == 0) {
//park
if(currentParkingNum == MAXPARKINGPOS) {
printf("Sorry,not empty!\n\n");
continue;
}
myParking = detailBuf+currentParkingNum;
printf("your name:\n");
gets(myParking-name);
printf("your parking num:\n");
gets(myParking-num);
numEexisted = 0;
for(i=0;icurrentParkingNum;i++) {
if(strcmp(detailBuf[i].num,myParking-num) == 0) {
numEexisted =1;
break;
}
}
if(numEexisted != 0) {
printf("The car %s is in\n\n",myParking-num);
goto selectService;
}
selectPrice:
printf("Service cost,what is your choice?\n");
for(int i=0;i MAXPRICETYPE; i++) {
printf("%d.$%.2f per hour\n",i+1,priceBuf[i]);
}
gets(buf);
iChoice = atoi(buf);
if(!(iChoice = 1 iChoice =MAXPRICETYPE)) {
printf("Your choice is incorrect!\n\n");
goto selectPrice;
}
myParking-pricePerHour=priceBuf[iChoice-1];
time(myParking-start);
currentParkingNum++;
printf("Parcking ok!\n\n");
}else if(strcmp(buf,"2") == 0) {
//leave
printf("your parking num:\n");
gets(buf);
myParking = NULL;
for(i=0;icurrentParkingNum;i++) {
if(strcmp(detailBuf[i].num,buf) == 0) {
myParking = detailBuf[i];
leavingIndex = i;
break;
}
}
if(myParking ==NULL) {
printf("Cannot find your car!\n\n");
continue;
}
myParking-end = time(myParking-end);
myParking-period = difftime(myParking-end,myParking-start);
myParking-cost= myParking-period/3600.0*myParking-pricePerHour;
printf("****** Cost Details ******\n");
printf("name:%s\n",myParking-name);
printf("number:%s\n",myParking-num);
printf("price:%.2f\n",myParking-pricePerHour);
begin = localtime(myParking-start);
strftime(buf,sizeof(buf),"%Y-%m-%d %H:%M:%S",begin);
printf("begin:%s\n",buf);
end = localtime(myParking-end);
strftime(buf,sizeof(buf),"%Y-%m-%d %H:%M:%S",end);
printf("end:%s\n",buf);
printf("period:%.2f hour(s)\n",myParking-period/3600.0);
printf("cost:$%.2f\n",myParking-cost);
printf("service:$%.2f per hour\n",myParking-pricePerHour);
for(i = leavingIndex; i currentParkingNum;i++) {
if(i+1 currentParkingNum) {
detailBuf[i]=detailBuf[i+1];
}
}
detailBuf[currentParkingNum-1].cost=0.0;
detailBuf[currentParkingNum-1].end=0;
detailBuf[currentParkingNum-1].name[0]='\0';
detailBuf[currentParkingNum-1].num[0]='\0';
detailBuf[currentParkingNum-1].period=0.0;
detailBuf[currentParkingNum-1].pricePerHour=0.0;
detailBuf[currentParkingNum-1].start=0;
currentParkingNum--;
printf("Leaving ok!\n\n");
}else{
printf("Your choice is incorrect!\n\n");
continue;
}
}
return 0;
}
关于c语言设计POS机刷卡和刷卡编程与图形编程的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
还没有评论,来说两句吧...