On Fri, Feb 22, 2008 at 1:27 AM, burtonics <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  Thank you for the help. I am confused on how to get this program
>  rolling.
>
>  ***************************************
>  HERES THE PROJECT ASSIGNMENT:
<snip>
>  *****************************************************
>
>  Heres what i got so far, im sure i am wrong:

Yup. It won't compile....

>  #include <stdio.h>
>
>  main(void)
>
>  float purchasetotal, teacher, nonteach, salestx
>
>
>
>  printf("Enter The Total Of Purchase")"
>
>  Printf("Is The Purchaser A Teacher")"

...you don't have any input statements

>  if (teacher <=100 * .10 + .5)
>
>  if(teacher >=100 * .12) + .5)
>

calculations are wrong, and you don't assign the result to any variables

>
>  else
>
>  (nonteach + .5)

another wrong calculation.

You also don't have any output statements.

>  Any help would be very appreciated.

A more complete attempt would be appreciated as well. Basic outline of
what you need to complete this assignment follows - you need to fill
in the code where indicated by the comments:

#define SALES_TAX 5
#define DISCOUNT_LOW 10
#define DISCOUNT_HIGH 12
#define DISCOUNT_LIMIT 100

#include <stdio.h>

int main(void){
  double purchase_total, discount, discounted_total, sales_tax, sales_total;
  int is_teacher;
  FILE* output_file;

  // input purchase_total
  // input is_teacher

  if (is_teacher){
    // work out discount and discounted_total based on discount_total,
DISCOUNT_LIMIT and DISCOUNT_HIGH/DISCOUNT_LOW
  }else{
    // discounted_total is purchase_total, discount is zero
  }
  // work out sales_tax based on pretax_total and SALES_TAX
  // work out sales_total as discounted_total plus sales_tax

  // open output_file
  // print to file:
    // purchase total
    if (is_teacher){
      // discount
      // discounted_total
    }
    // sales_tax
    // sales_total
    // close output_file

  return 0;
}

-- 
PJH

http://shabbleland.myminicity.com/tra

Reply via email to