University Project: Using Files


  • Step 1: Take Input: Enter number of courses taken.
  • Step2: Enter name/code of the book or code of the course for which the book is required.
  • Step 3: Read price from the file for the entered book into an array.
  • Step 4: Repeat steps 2 & 3 until all the courses are entered.
  • Step 5: Sum the value of prices
  • Step 6: Write the content of array in the second file.
  • Step 7: Prompt the student to select shipping options: ‘delivery’ or ‘pick-up’
  • Step 8: If “Pickup” option is selected then go to step 11, else continue.
  • Step 9: If shipping charges are greater than 0, add these to total price.
  • Step 10: Display the total price and shipping date.
  • Step 11: Display the total price and display message to inform the customer that books can be picked up from the store.
  • Step 12: Take credit card number as input
  • Step 13: Use sequential search algorithm for searching the array that whether the credit card number exists or not.
  • Step 14: If the credit card number is found, display that “credit card number is valid”, else display the message that “credit card number is invalid”. 

Flow Chart