I am trying to print a hard copy of my code's output but I am not sure what t write in my code to have the output turn into a pdf or txt file right after it is displayed.
The code below is just a part of my whole project. This will generate the output that I want to display on my hardcopy.
float totaldinein()
//This function is to calculate the total price of DINING IN including the 5% government tax and 10% dining in charges.
{
system("cls");
printf("Select your payment method:1--> Cash Payment 2--> Credit Card Payment\n");
scanf("%d",&t);
switch (t)
{
case 1: total1 += (faj+taco+tost+chim+flau+burr+fried)*1.15;
//Calculation for grand total with government taxes,and cash payment.
printf(" Item Price of 1 Total Price \n");
printf(" Fajitas 8.00 $%.2f\n",faj);
printf(" Tacos 5.00 $%.2f\n",taco);
printf(" Tostadas 7.00 $%.2f\n",tost);
printf(" Chimichanga 12.00 $%.2f\n",chim);
printf(" Flautas 10.00 $%.2f\n",flau);
printf(" Burrito 8.00 $%.2f\n",burr);
printf(" Fried ice cream 5.00 $%.2f\n",fried);
printf("\nThe Total is $%.2f\n\n",total1);
break;
case 2: total1 += (faj+taco+tost+chim+flau+burr+fried)*1.18;
//Calculation for grand total with government taxes,and credit card payment.
printf(" Item Price of 1 Total Price \n");
printf(" Fajitas 8.00 $%.2f\n",faj);
printf(" Tacos 5.00 $%.2f\n",taco);
printf(" Tostadas 7.00 $%.2f\n",tost);
printf(" Chimichanga 12.00 $%.2f\n",chim);
printf(" Flautas 10.00 $%.2f\n",flau);
printf(" Burrito 8.00 $%.2f\n",burr);
printf(" Fried ice cream 5.00 $%.2f\n",fried);
printf("\nThe Total is $%.2f\n\n",total1);
break;
default: system("cls");
printf("\nInvalid Error");
}
}
float totaltakeout()
//This function is to calculate the total price of TAKE AWAY including the 5% government tax and 5% dining in charges.
{
system("cls");
printf("Select your payment method:1--> Cash Payment 2--> Credit Card Payment\n");
scanf("%d",&t);
switch (t)
{
case 1: total1 += (faj+taco+tost+chim+flau+burr+fried)*1.10;
//Calculation for grand total with government taxes,and cash payment.
printf(" Item Price of 1 Total Price \n");
printf(" Fajitas 8.00 $%.2f\n",faj);
printf(" Tacos 5.00 $%.2f\n",taco);
printf(" Tostadas 7.00 $%.2f\n",tost);
printf(" Chimichanga 12.00 $%.2f\n",chim);
printf(" Flautas 10.00 $%.2f\n",flau);
printf(" Burrito 8.00 $%.2f\n",burr);
printf(" Fried ice cream 5.00 $%.2f\n",fried);
printf("The Total is $%.2f\n\n",total1);
break;
case 2: total1 += (faj+taco+tost+chim+flau+burr+fried)*1.13;
//Calculation for grand total with government taxes,and credit card payment.
printf(" Item Price of 1 Total Price \n");
printf(" Fajitas 8.00 $%.2f\n",faj);
printf(" Tacos 5.00 $%.2f\n",taco);
printf(" Tostadas 7.00 $%.2f\n",tost);
printf(" Chimichanga 12.00 $%.2f\n",chim);
printf(" Flautas 10.00 $%.2f\n",flau);
printf(" Burrito 8.00 $%.2f\n",burr);
printf(" Fried ice cream 5.00 $%.2f\n",fried);
printf("The Total is $%.2f\n\n",total1);
break;
default: system("cls");
printf("\nInvalid Error");
}
}