Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
32 views
Comp Assignment 2
Uploaded by
tRz. Aun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Comp Assignment 2 For Later
Download
Save
Save Comp Assignment 2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
32 views
Comp Assignment 2
Uploaded by
tRz. Aun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Comp Assignment 2 For Later
Carousel Previous
Carousel Next
Download
Save
Save Comp Assignment 2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 8
Search
Fullscreen
Run vue’ Yate Secion: ee COMPUTER SCIENC ICE - 9618 (A1) — PAPER 2 Assignment #2 Topic: File Handling Deadline: 21" Nov, 2023 01. Toni has a large collection of jazz CDs that are stored in different places. She wants to record where the CDs are stored. She decides to write a program to do this. The program must store the data in a file, HyMusic. (@) () Whyisa file needed? pecmonently eedes...S0 ink heat san ed evdm odber the. commukes oo == i) (Wl) Myttusiic is a text file with the data for each CD as one line of text. Data for a typical CD are: Title: Kind of Green Artist: Miles Coltrane Location: Rlack1-5 The line will be formed by concatenating the three data items. For tho example above, the line stored will be: Kind of GreenMiles ColtraneRack1-5 Deseribe a problem that might occur when organising the data in this way. Describe a possible solution. can be used A Saptcares...owachr.. foe caomels:5. 8... lard.He ‘a(b) Toni must input the data into the file for all of her CDs. A procedure, Input Data, is needed to do this. Toni designs the procedure and chooses the following identifiers: " Identifier | Data type STRING STRING STRING The procedure repeatedly performs the following steps: + input a CD title (A rogue value of “##” is to be used to end the input) + input the artist * input the location * create the text line + write the text line to the file When the rogue value is encountered the file is closed.02, The information is stored in a text file, s text file is as follows: oreDetails.txt. The format of each line of the
+ Membershiptumber is a four-digit numeric string + pate is a six-digit numeric string in the format DDMMYY Score is a two-digit numeric string in the range "50" to "99" Aprocedure, AddNewScores (), is being developed. This will allow the user to enter scores for several members on a particular date. The procedure, AddNewscores (), will perform the following actions: 1. Prompt for the date of the scores. 2. Input the date of the scores. 3. Prompt for the membership number. 4. Input the membership number. 5. Ifthe membership number is an emply string then end the procedure. 6. Prompt for the score. 7. Input the score. 8. Validate the score. 9. Ifthe validation fails then repeat from step 6. 0. Form a text string from the data and write this to the ScoreDetails. txt file }1. Repeat from step 3.Write Pseudocode for the AdaNeuscores() procedure. RROLEDURE... KAANew Scones O) DECLARE. Filemaker Koreboka, Member” sui pNumber, Scone: STRING OUTPUT.“ Gnker dake..of scants” INPUA Sere ake. GRENFELL E.* Sore Debebte. txk" FoR APPEND vs eos...“ \veuk membedlp nuwsber” ANC. Sebvedaker momberde pNumber WHILE, aan. Mem borshioNunber £5“ ” OUTCUT, “Canker score” NEON Sen ce eae te AWCeord 2) OUTPUT “Inpuk.. store, behwewn So and. 94% ANQUT Scone ENwowie Fiterla= MembersuaNunbe & Sore bate & Lone, WIRMIEFILE. “Scone bekails-tah", Fienaka. ONO Inp We. meen bees meen lye \NEoL Membershipaumger Qrownhe CLOSEFILE CScorenetails tak) PAO RocEMURE (9)03. A procedure, count tines (), i being written to count the number of lines in a text fie, The procedure will take a flename asa string parameter ‘count the number of lines in the file ‘output a single suitable message that includes the total number of lines. White pseudocode forte procedure counttines Vpgece wee CounkLines CH Ve Name Shing) DECLARE LineNurs. ANTEC DECURRE umnedeka: STRING LineNun SO OPENTILE. FileName... Fon... PEND. WHILE Nov. Eor CEi\ BERDEILE. Ge Name ,.. Une Dele... FUE ARAL NirdineAed Lina Num CLint Noes) LROWWALE, CLOSE. Filename, OUTRUT “Ne. ok, Uaneb =". Line Nuuen ENvRRocepuce. 6)04, (a) A concert venue uses a program to calculate admission prices and store information about ticket sales. fanto be inboragn atthe sar ofeach day bere ony tts canbe St The process very ime consuming, (1) Explain how the program could us text les to speed up the process, Dake..coun. Ve. sowed... permanunkly. in. Ges. bulore toabetotser inning ofA. compute ..The dade. coud Not. saad...feor Yne. RLE..anck added... loadk....to ASA CAND VING Hne....NCRO: Or eoeatening. Berke. (2) (i) State the characterise of text fes hat alow them tobe used a explained in pat (() Roako.in...heak Rls is Stored permanently (1) (itl) information about ticket sales will be stored as a booking. The booking requires the following data: + name of person booking + number of people in the group (for example a family ticket or a school party) + event type. ‘Suggest how data relating to each booking may be stored in a text file. Dake. vhems.are..cormbined.\0. form... Single Skeiny ond ave. sapecnker...\oy...0..Checad er.nod sodeds. ys. Mae. dake: 2(b) Aprocedure Preview () will take the name of a text file as a parameter output e warning message i the fl s empty otherwise output the first five lines from the file (or as many lines as there are in the file if this number is less than five) Write pseudocode forthe procedure Preview) PROCEDURE PrewiewCFieName STRING) DECLARE, LineNum = \NIEGER | DECLARE F lineata: TLRANG _OPEMEILE, Filename, EOR READ \e Eee ( FileName) THEN DVT RYT, Sewarcning Ble is amply”. ELSE. oe LaneNune\ ALLE LineNum © C25 AND. NOR. Core CUWMEIIAD (Serr REROFILE, CW May Main FileName, Ling Daba OULRAH ARMA. 907._. Linedato LineNuwn & LindgNum +) ENWRILE ENn IE. CLOSbFILE, ile Name. ENPROLED ORE.
You might also like
Z Notes Comp p2
PDF
No ratings yet
Z Notes Comp p2
9 pages
Caie A2 Level Computer Science 9618 Theory v1
PDF
100% (1)
Caie A2 Level Computer Science 9618 Theory v1
21 pages
Cambridge International Computer Science 2
PDF
No ratings yet
Cambridge International Computer Science 2
9 pages
Cambridge International Advanced Subsidiary and Advanced Level
PDF
No ratings yet
Cambridge International Advanced Subsidiary and Advanced Level
16 pages
CAIE AS Level Computer Science 9618 Practical v1 Z-Notes
PDF
100% (1)
CAIE AS Level Computer Science 9618 Practical v1 Z-Notes
9 pages
Computer Science P2 Unsolved 2023-2024
PDF
No ratings yet
Computer Science P2 Unsolved 2023-2024
15 pages
11.4-Text-File-Handling-EMK-Notes-2024
PDF
No ratings yet
11.4-Text-File-Handling-EMK-Notes-2024
4 pages
Caie As Computer Science 9618 Practical v3
PDF
No ratings yet
Caie As Computer Science 9618 Practical v3
9 pages
Caie As Computer Science 9608 Practical
PDF
No ratings yet
Caie As Computer Science 9608 Practical
9 pages
Caie As Level Computer Science 9618 Practical 634fb2359fe6a24c6da54e50 246
PDF
No ratings yet
Caie As Level Computer Science 9618 Practical 634fb2359fe6a24c6da54e50 246
9 pages
Files: For Multiple-Choice and Essay Questions
PDF
No ratings yet
Files: For Multiple-Choice and Essay Questions
6 pages
Caie As Level: Computer Science
PDF
No ratings yet
Caie As Level: Computer Science
9 pages
Caie As Computer Science 9618 Practical Notes and Guide
PDF
No ratings yet
Caie As Computer Science 9618 Practical Notes and Guide
8 pages
CAIE-As Level-Computer Science - Practical
PDF
No ratings yet
CAIE-As Level-Computer Science - Practical
11 pages
System Programming
PDF
No ratings yet
System Programming
26 pages
1.1P
PDF
No ratings yet
1.1P
6 pages
SN. Program Description Topic
PDF
No ratings yet
SN. Program Description Topic
5 pages
Index For C++ Programming: Computer Science (083) Practical File For Class XII
PDF
No ratings yet
Index For C++ Programming: Computer Science (083) Practical File For Class XII
6 pages
Caie A2 Level: Computer SCIENCE (9618)
PDF
No ratings yet
Caie A2 Level: Computer SCIENCE (9618)
20 pages
C++ For Engineers and Scientists 4th Edition Bronson Test Bank Download
PDF
100% (29)
C++ For Engineers and Scientists 4th Edition Bronson Test Bank Download
7 pages
Starting Out with Python 4th Edition Gaddis Test Bank download
PDF
100% (1)
Starting Out with Python 4th Edition Gaddis Test Bank download
39 pages
Practical File 2018
PDF
No ratings yet
Practical File 2018
6 pages
ADS2_Chap4_Files_25
PDF
No ratings yet
ADS2_Chap4_Files_25
14 pages
A LEVEL COMPUTER SCIENCE 9618 PAPER 03 NOTES BY MR SAEM
PDF
No ratings yet
A LEVEL COMPUTER SCIENCE 9618 PAPER 03 NOTES BY MR SAEM
20 pages
CAIE-As Level-Computer Science - Practical
PDF
No ratings yet
CAIE-As Level-Computer Science - Practical
11 pages
Computer Science A Level Pre-Released Material 2016
PDF
No ratings yet
Computer Science A Level Pre-Released Material 2016
8 pages
mason_pseudocode
PDF
No ratings yet
mason_pseudocode
2 pages
DATA FILE HANDLING REVISION CLASS 12 CHENNAI PUBLIC SCHOOLS
PDF
No ratings yet
DATA FILE HANDLING REVISION CLASS 12 CHENNAI PUBLIC SCHOOLS
4 pages
File I - o Processing 2019
PDF
No ratings yet
File I - o Processing 2019
2 pages
Computer Science 22:01:22
PDF
No ratings yet
Computer Science 22:01:22
14 pages
Unit wise list of questions for practical file
PDF
No ratings yet
Unit wise list of questions for practical file
6 pages
Tutorial-9_File Handling
PDF
No ratings yet
Tutorial-9_File Handling
1 page
Input and Output Manipulations
PDF
No ratings yet
Input and Output Manipulations
29 pages
CAIE-AS Level-Computer Science - Practical
PDF
No ratings yet
CAIE-AS Level-Computer Science - Practical
10 pages
Term2 Week 1 Lesson Csc Year 13
PDF
No ratings yet
Term2 Week 1 Lesson Csc Year 13
8 pages
Programming Techniques End of Unit Quiz Lesson Element
PDF
No ratings yet
Programming Techniques End of Unit Quiz Lesson Element
13 pages
p2 Notes 3
PDF
No ratings yet
p2 Notes 3
10 pages
Pseudocode Caie
PDF
No ratings yet
Pseudocode Caie
6 pages
Unsolved MCQs
PDF
No ratings yet
Unsolved MCQs
2 pages
CAIE-A2 Level-Computer Science
PDF
No ratings yet
CAIE-A2 Level-Computer Science
26 pages
Y12 CS T2 W6 L1 Ch10 - Records - Files
PDF
No ratings yet
Y12 CS T2 W6 L1 Ch10 - Records - Files
26 pages
Sequential File Handling
PDF
No ratings yet
Sequential File Handling
4 pages
Functions_Procedures
PDF
No ratings yet
Functions_Procedures
9 pages
Computer Science Unit-5 Sem 1
PDF
No ratings yet
Computer Science Unit-5 Sem 1
7 pages
08 Slide Extended
PDF
No ratings yet
08 Slide Extended
44 pages
file_wk
PDF
No ratings yet
file_wk
7 pages
Presentation On Data File Handling
PDF
No ratings yet
Presentation On Data File Handling
36 pages
PseudoCode Memorisation Exercises
PDF
No ratings yet
PseudoCode Memorisation Exercises
5 pages
Week11 2+12
PDF
No ratings yet
Week11 2+12
47 pages
CAIE-AS Level-Computer Science - Practical
PDF
No ratings yet
CAIE-AS Level-Computer Science - Practical
10 pages
CSC-9618 Mock 1 A2 Paper 4
PDF
No ratings yet
CSC-9618 Mock 1 A2 Paper 4
7 pages
Chapter 4 File Handlinf Final (New)
PDF
No ratings yet
Chapter 4 File Handlinf Final (New)
78 pages
Next Steps Computer Science 9608 June 18 - Paper21 - Q5
PDF
No ratings yet
Next Steps Computer Science 9608 June 18 - Paper21 - Q5
3 pages
Data representation
PDF
No ratings yet
Data representation
11 pages
CS Xii RF3 Files 2024 25
PDF
No ratings yet
CS Xii RF3 Files 2024 25
2 pages
C++ Programing Worksheet
PDF
No ratings yet
C++ Programing Worksheet
3 pages
PC Unit 5
PDF
No ratings yet
PC Unit 5
58 pages
Unit 4
PDF
No ratings yet
Unit 4
24 pages
Add Math 29th June
PDF
No ratings yet
Add Math 29th June
3 pages
Chem Worksheet
PDF
No ratings yet
Chem Worksheet
4 pages
Unit 2.2, 2.1 and 2.3
PDF
No ratings yet
Unit 2.2, 2.1 and 2.3
10 pages
Phy 2
PDF
No ratings yet
Phy 2
4 pages