Join TSR now and get all your revision questions answeredSign up now

Gcse - computing python a453 2017 help!

    • Thread Starter
    Offline

    0
    ReputationRep:
    I need help with GCSE computing a453 2017 im unable to do task 2 and 3.
    Offline

    2
    ReputationRep:
    Hi , could you tell me what the questions are and I'll help you solve them
    Offline

    0
    ReputationRep:
    No
    Offline

    0
    ReputationRep:
    (Original post by amrit_sv)
    Hi , could you tell me what the questions are and I'll help you solve them
    Q2) Develop a program that identifies individual words in a sentence, stores these in a list and replaces each word in the original sentence with the position of that word in the list. E.g. the sentence 'ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT YOU CAN DO FOR YOUR COUNTRY'. The output should be [1,2,3,4,5,6,7,8,9,1,3,9,6,7,8,4, 5]. Save the list of words and positions in an external file (single or separate).

    Q3) Develop a program that builds upon the technique from Task 2 to compress a text file with several sentences, including punctuation. The program should be able to compress a file into a list of words and list of positions to recreate the original file. It should also be able to take a compressed file and recreate the full text. Including punctuation and capitalisation, of the original file.

    (I need help too pls aha, only on Task 3 though, I've done Task 2)
    Offline

    3
    ReputationRep:
    (Original post by needtocoursework)
    Q2) Develop a program that identifies individual words in a sentence, stores these in a list and replaces each word in the original sentence with the position of that word in the list. E.g. the sentence 'ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT YOU CAN DO FOR YOUR COUNTRY'. The output should be [1,2,3,4,5,6,7,8,9,1,3,9,6,7,8,4, 5]. Save the list of words and positions in an external file (single or separate).

    Q3) Develop a program that builds upon the technique from Task 2 to compress a text file with several sentences, including punctuation. The program should be able to compress a file into a list of words and list of positions to recreate the original file. It should also be able to take a compressed file and recreate the full text. Including punctuation and capitalisation, of the original file.

    (I need help too pls aha, only on Task 3 though, I've done Task 2)
    Q2) It is good you said that, as it is too easy to bother trying to help you. If you can't do this stay away from programming.
    Q3) Basically using 2, create a dictionary between numbers and text, so that passing the array above produces a new array with sentence. (Not a very efficient compression I might add, but answers the question.) Too easy also, somehow I think you're not going to be the next Linus Torvalds.
 
 
 
Poll
Which party will you be voting for in the General Election 2017?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Quick reply
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.