Homework3-1 - Homework #3 /* * Program Hw3_1.c * Written by...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * Program Hw3_1.c * Written by Justin Waters * Inputs: user status, purchase amount * Outputs: detailed receipt in seperate file * Description: User states if he is/isn't a teacher, tells how much he spent, and he gets a detailed receiipt of his purchase * */ #include <stdio.h> //printf, scanf defined #include <math.h> //math functions defined #define discount1 0.10 //defines 10 % tax value #define discount2 0.12 //defines 12 % tax value #define taxx 0.05 //defines 5 % sales tax int main (void) { int identify; //tells if user is a teacher or not int stax; //sales tax int t1tax; //10 % tax discount for teachers int t2tax; //12 % tax discount for teachers double pchs_amt, teach_dis, tax, ttl, dis_total; //used for calculations FILE *fpout; //lets program print to outside files fpout = fopen("receipt.txt", "w"); //opens/creates out file //tax values used stax = 5; t1tax = 10; t2tax = 12; //finds out if user is a teacher or not printf("If you are a teacher, enter '1'.\n If you aren't a teacher, enter '2'.");
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Homework3-1 - Homework #3 /* * Program Hw3_1.c * Written by...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online