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
#2
No question?
What have you tried?
Show us the code in proper tags. Show us the errors if any and tell us what is the issue with your assignment. I presume that this is a homework.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  about write file wrong (Edit directly online) CNenfan 4 2,452 Jan-29-2021, 05:32 AM
Last Post: deanhystad
  Write to file emilng 1 1,678 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,507 Sep-26-2020, 12:10 PM
Last Post: ibreeden
  [split] how to read a specific row in CSV file ? laxmipython 2 8,799 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,876 May-15-2020, 04:57 PM
Last Post: snippsat
  read from file mcgrim 16 6,019 May-14-2019, 10:31 AM
Last Post: mcgrim
  Read directly from excel file using python script dvldgs05 0 2,228 Oct-19-2018, 02:51 AM
Last Post: dvldgs05
  write split words of sentence to file bluefrog 1 2,951 Aug-27-2018, 01:28 AM
Last Post: micseydel
  Read a data from text file (Notepad) Leonzxd 24 13,662 May-23-2018, 12:17 AM
Last Post: wavic
  read a binary file to find its type atux_null 7 17,144 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