Computer Science - 9210 OxfordAQA

Input/output And File Handling

Aperçu

Close a program and everything it was holding disappears. Every variable, every array, every record: gone the instant the process ends, because they lived in memory and memory is handed back. A high score that survives until tomorrow, a register that is still there next term, a saved game: all of them require the program to push its data across a boundary, out of itself and onto something that outlives it.

This lesson covers the three things the specification asks for. Obtaining user input from a keyboard, outputting data and information from a program to the computer display, and reading from and writing to a text file. You will learn why everything typed at a keyboard arrives as text whatever it looks like, how a program knows when a file has run out, and the difference between writing to a file and adding to one, which is the difference between saving today's readings and destroying every reading you ever took.

Objectifs

  1. Be able to obtain user input from a keyboard. Be able to output data and information from a program to the computer display. Be able to read/write from/to a text file.

Carte mentale

Ce theme est schematise pour montrer comment les idees se relient.

Ouvrez la carte mentale dans l'application

Note de cours

Everything a program does divides into three regions, and you met them when you learned to read an algorithm. Input is where data crosses into the program from outside. Processing is everything that happens to data the program already holds. Output is where data crosses back out. This topic is about the two crossings, and the specification names four of them: obtaining input from a keyboard, sending output to the computer display, reading from a text file, and writing to a text file.

Fiche complete disponible sur l'application Green Bridge

Installez l'application Green Bridge CBT sur votre telephone ou votre ordinateur pour acceder a toute la bibliotheque IGCSE : sujets d'examen, baremes, cartes mentales, fiches memo et lecons audio.

Notes de cours complètes avec diagrammes
Assistant d'apprentissage piloté par l'IA
Des examens blancs chronometres, corriges des que vous terminez
Disponible sur Android, Windows, macOS et Linux Application iOS bientot disponible

Évaluation de la leçon

Félicitations, vous avez terminé la leçon sur Input/output And File Handling. Maintenant que vous avez exploré le concepts et idées clés, il est temps de mettre vos connaissances à lépreuve. Cette section propose une variété de pratiques des questions conçues pour renforcer votre compréhension et vous aider à évaluer votre compréhension de la matière.

Vous rencontrerez un mélange de types de questions, y compris des questions à choix multiple, des questions à réponse courte et des questions de rédaction. Chaque question est soigneusement conçue pour évaluer différents aspects de vos connaissances et de vos compétences en pensée critique.

Utilisez cette section d'évaluation comme une occasion de renforcer votre compréhension du sujet et d'identifier les domaines où vous pourriez avoir besoin d'étudier davantage. Ne soyez pas découragé par les défis que vous rencontrez ; considérez-les plutôt comme des opportunités de croissance et d'amélioration.

  1. What data type does a value obtained from a keyboard have before any conversion? A. Boolean B. Integer C. Real D. String Answer: D
  2. A program opens an existing text file in write mode. What happens to the data already in the file? A. It is kept and new data is added at the end B. It is kept and new data is added at the start C. It is destroyed D. The program refuses to open the file Answer: C
  3. Which loop structure is most appropriate for reading every line of a text file whose length is not known? A. A FOR loop from 0 to the number of lines B. A WHILE loop testing for the end of the file C. A FOR loop from 1 to 100 D. No loop is needed Answer: B
  4. Why should a program close a file it has written to? A. To force any buffered data out to the disk and release the file B. To convert the data into text C. To sort the contents of the file D. To make the file readable by a person Answer: A
  5. A program stores data in a file rather than in an array. What is the main advantage? A. The data can be sorted more quickly B. The data survives after the program ends C. The data does not need to be converted D. The data uses less memory while the program runs Answer: B

Travaillez ces questions dans l'application

Travaillez ces questions dans l'application

Pratiquez des questions blanches

Vous voulez vous entraîner sur des questions blanches sur Input/output And File Handling ? Téléchargez lapplication Green Bridge CBT pour accéder à des questions blanches et à des évaluations complètes sur ce sujet.

Téléchargez l'application sur Google Play.

Tout ce dont vous avez besoin pour exceller au JAMB, WAEC et NECO.

Green Bridge CBT Mobile App
Assistant de chat d'apprentissage personnalisé par IA
Plus de 200 000 questions d'examen IGCSE, JAMB, WAEC et NECO.
Plus de 1200 notes de cours
Assistance Hors Ligne - Apprenez à Tout Moment, Partout
Horaire du Pont Vert
Résumés littéraires et questions potentielles
Suivez vos performances et votre progression
Explications Approfondies pour un Apprentissage Complet