Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Wednesday, January 18
- This homework contains code to be submitted electronically.
Put your code in a folder called
hw03and submit using the
- This is an electronic homework and you do not need to print out anything to turn in during class.
- Required reading: Section 3: Data representation and Section 4: I/O and type conversions from the Unit 2 class notes.
Write a program in a file called
checkout.cthat does a very simple grocery store checkout: it should read in the name of an item, the cost of that item, and how many of that item someone is buying. Then your program should print out a line like
5 apples cost $3.55showing the total cost.
Example of running your program:
gcc checkout.c -o checkout
Example input typed in to your program:
tacos 1.22 3
Example output from your program:
3 tacos cost $3.66
Submit your program in a file called
checkout.cusing the online submission system.
Hint: Check out the C functions reference page for a quick reference on how to use the input/output commands you'll need.
Hint: The submit instructtions show how to submit code for the assignments in this class.