Python Forum
Homework - Read from/Write to file (renamed from Help help help)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Homework - Read from/Write to file (renamed from Help help help)
#1
1. Scenario
An electronic store which sells electronic appliances maintains its inventory in
a text file. An application needs to be developed which will read the text file
and display the products available. Then with each purchase an invoice
should be generated for the particular customer and should be written into a
file. The inventory should also be updated with each purchase. For example,
if the store had 30 mobile phones available, then if 1 mobile phone is sold the
number should be changed to 29.
A sample format of the text file containing the information about the products
is as follows:
phone,200,30
laptop,900,49
HDD,200,40
The 1st column is the name of the product, 2nd column is the price and the 3rd
column is the number of pieces in stock.
*You can use your own format and add other information too
An invoice should be generated for each purchase and should contain the
name of the customer, the products bought, the discounted amount (if
available), the total purchase amount and the date and time of the purchase.
Each invoice should have a unique name and should be written to file. The
format of the invoice is up to you.
Reply


Messages In This Thread
Homework - Read from/Write to file (renamed from Help help help) - by Amitkafle - Jan-11-2018, 07:17 AM
RE: Help help help - by wavic - Jan-11-2018, 07:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  about write file wrong (Edit directly online) CNenfan 4 2,526 Jan-29-2021, 05:32 AM
Last Post: deanhystad
  Write to file emilng 1 1,723 Nov-08-2020, 08:44 PM
Last Post: Gribouillis
  Can we store value in file if we open file in read mode? prasanthbab1234 3 2,575 Sep-26-2020, 12:10 PM
Last Post: ibreeden
  [split] how to read a specific row in CSV file ? laxmipython 2 8,882 May-22-2020, 12:19 PM
Last Post: Larz60+
  Read data from a CSV file in S3 bucket and store it in a dictionary in python Rupini 3 6,999 May-15-2020, 04:57 PM
Last Post: snippsat
  read from file mcgrim 16 6,161 May-14-2019, 10:31 AM
Last Post: mcgrim
  Read directly from excel file using python script dvldgs05 0 2,256 Oct-19-2018, 02:51 AM
Last Post: dvldgs05
  write split words of sentence to file bluefrog 1 2,986 Aug-27-2018, 01:28 AM
Last Post: micseydel
  Read a data from text file (Notepad) Leonzxd 24 13,911 May-23-2018, 12:17 AM
Last Post: wavic
  read a binary file to find its type atux_null 7 17,307 Nov-24-2017, 10:18 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020