- 分享
- 0
- 人气
- 0
- 主题
- 14
- 帖子
- 2007
- UID
- 96129
- 积分
- 1491
- 阅读权限
- 18
- 注册时间
- 2007-8-28
- 最后登录
- 2017-6-16
- 在线时间
- 3887 小时
|
能运行的Coding(一)
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
int code=37, a=0, f=0, stuff_password=0, customer_password[10]={0}, password_input=0, check_flag=0;
char choice=0, icno_search[15]={""};
char name[10][50]={""}, icno[10][15]={""}, DOB[10][15]={""}, sex[10]={""};
float total_income[10]={0}, total_relief[10]={0}, total_rebate[10]={0}, pre_payment[10]={0}, taxable_amount[10]={0};
float amount_payment[10]={0};
while(choice!='D'&& choice!='d')
{
printf("Tax Advisor Program\n");
printf("(A) Display taxation rate\n");
printf("(B) Input tax payer's particulars\n");
printf("(C) Compute and display tax payable\n");
printf("(D) Quit\n");
printf("\n(Z) For STUFF only\n");
printf("\n\tEnter Choice: ");
flushall();
scanf("%c", &choice);
switch(choice)
{
case 'a' :
case 'A' : printf("\n\nTax Rate Information Table\n");
printf("==========================");
printf("\n\t\tIncome\t\tRate\n");
printf("\t\t$\t\t(%c)\n", code);
printf("On the frist\t20,000\t\t0\n");
printf("On the next\t10,000\t\t3.5\n");
printf("On the next\t10,000\t\t5.5\n");
printf("On the next\t40,000\t\t8.5\n");
printf("On the next\t80,000\t\t14\n");
printf("On the next\t160,000\t\t17\n");
printf("Above\t\t320,000\t\t20\n");
printf("\n\n");
break;
case 'b' :
case 'B' : a=a+1;
printf("\n\n");
printf("Fill Your Descriptions in the following\n");
printf("=======================================");
printf("\n[S/N %d] Enter NRIC no.: ",a);
flushall();
scanf("%s", &icno[a]);
printf("[S/N %d] Enter Name: ", a);
flushall();
gets(name[a]);
printf("[S/N %d] Enter Date of Birth(DD-MM-YYYY): ", a);
flushall();
gets(DOB[a]);
printf("[S/N %d] Enter Sex(M/F): ", a);
flushall();
scanf("%c", &sex[a]);
printf("[S/N %d] Enter Total Income: $", a);
flushall();
scanf("%f", &total_income[a]);
printf("[S/N %d] Enter Total Relief: $", a);
flushall();
scanf("%f", &total_relief[a]);
printf("[S/N %d] Enter Total Rebate: $", a);
flushall();
scanf("%f", &total_rebate[a]);
printf("\n");
printf("[S/N %d] Setting Your PASSWORD (6 Digits): ", a);
flushall();
scanf("%d", &customer_password[a]);
printf("\n\n");
printf("**To compute and display your amount payment, please press C to continue.\n\n\n");
pre_payment[a] = total_income[a] - total_relief[a];
[ 本帖最后由 无我不在 于 2009-1-16 09:50 PM 编辑 ] |
|