C++ exam question challenge

Hello all. I have used this forum before for help with my c++ programs and I really like it. This is my first post as an actual user, and I kind of wanted to get some feedback on a program we had to write on an exam in class.

I am currently in CS 135 (computer science 1) class in my university and we recently had our second exam. This was one of the questions (it is slightly paraphrased since I don't have a copy of the exam).

IF YOU WANT TO TIME YOURSELF START THE TIMER AT END OF THIS MESSAGE. YOU ARE ONLY ALLOWED A BLANK PIECE OF PAPER AND A PENCIL, AND NO REFERENCE.
START TIMER AND READ:


Write a complete C++ program that will read from a file the customer ID and
number of items that a customer is purchasing. If the number of items is
less than six, the cost will be $134.00 per item, if the number of items is more than 6, the cost will be $120.00 per item. The program must use 3 user defined functions that for each set of entries will:

1) read input from file
2) calculate the total cost
3) display the customer id, number of items and total (with 2 decimal places).


Since I never programmed before, I really don't know what would be a reasonable time amount that this should take (this was one of 30 problems on an hour and 15 minute exam).
Thanks to all who reply.
I actually ran out of time at the end... ;)






Topic archived. No new replies allowed.