Corrections proposées par Mr Adnen Smii. Propositions de correction Bac Pratique informatique 4 scientifiques -27 mai h

Similar documents
Correction Bac pratique 28/05/2012 8h30

Correction proposée par Mr Najeh SOUGUIR 1/8

sujet1: Correction Des Epreuves D Informatique _--Pratique--_ MEDDEB Mohamed Page 1 Devoirs et examens :

Correction bac pratique 2012 g1

SERIE N 1. 4 ème Année informatiques. Exercice 3. Exercice 4 (Manuel Scolaire) Page [1] Les enregistrements & Les fichiers Infoslpm.e-monsite.

In Delphi script, when values are assigned to variables, the colon-equal operator is used; :=

... ; ako je a n parno. ; ako je a n neparno

A New Method of Using Polytomous Independent Variables with Many Levels for the Binary Outcome of Big Data Analysis

Making Decisions In Pascal

Préparation au concours ACM TP 2

Annex A (Informative) Collected syntax The nonterminal symbols pointer-type, program, signed-number, simple-type, special-symbol, and structured-type

Computer Science II TURBO PASCAL

Making Decisions In Pascal

b) program deljiv3; uses wincrt; var i:integer; begin i:=3; while i<100 do begin write(i:5); i:=i+3; end; end.

Analyse statique de programmes avioniques

VLANs. Commutation LAN et Wireless Chapitre 3

TD 2. Correction TP info

A/L 2011_revision. PASCAL PROGRAMMING

Telecommunications and Internet Access By Schools & School Districts

HUMAN COMPUTER INTERFACE

{ -- FLORIDA HIGH SCHOOLS COMPUTING COMPETITION '84 } { -- PASCAL PROGRAM SOLUTIONS }

Bridging Activity for September A level Computer Science. Why do I need to complete a bridging activity?

ASSIGNMENT 4 SOLUTIONS

COMPUTER SCIENCES II Spring Term 2017 Asst.Prof.Elgin KILIÇ

with Ada.Numerics.Float_Random; with Ada.Containers.Vectors; procedure CalculDeMatrices is

Fall 2007, Final Exam, Data Structures and Algorithms

Data Structures and Algorithms CSE 465

The Lincoln National Life Insurance Company Universal Life Portfolio

1. General Computer Questions

Abe Mirza Test 1 Review & Practice Math 1. List all the elements for: 1. B C 2. B A 3. C B. Draw the Venn diagram and shade the proper region for,

Making Decisions In Pascal In this section of notes you will learn how to have your Pascal programs to execute alternatives

Latest information prior to deployment of "Dialogys V7.5.6" Contents. What is Dialogys? How often is data updated?... 5

ILLUSTRATION DES EXCEPTIONS

DEPARTMENT OF HOUSING AND URBAN DEVELOPMENT. [Docket No. FR-6090-N-01]

Panelists. Patrick Michael. Darryl M. Bloodworth. Michael J. Zylstra. James C. Green

Improved Gomory Cuts for Primal Cutting Plane Algorithms

Computer Science II TURBO PASCAL

Programing in C. Pierre-Alain FOUQUE

The Personal Information Canadians Give to Retailers

A Communications Network???

free download pnu pdf file from

Unit 7 Day 5 Graph Theory. Section 5.1 and 5.2

Information Coding. Content

Input parameters. Function. An ideal black-box representation of a function

Getting Started With Pascal Programming

Héritage (2) Programmation Orientée Objet. Jean-Christophe Routier Licence mention Informatique Université Lille Sciences et Technologies

Standard prelude. Appendix A. A.1 Classes

What is Structural Testing?

Distracted Driving- A Review of Relevant Research and Latest Findings

Chapter 2.4: Common facilities of procedural languages

Beginning Programming (Pascal) Lecture 21

Hyrje ne Informatike Seminar 5

Figure 1 Map of US Coast Guard Districts... 2 Figure 2 CGD Zip File Size... 3 Figure 3 NOAA Zip File Size By State...

MAKING MONEY FROM YOUR UN-USED CALLS. Connecting People Already on the Phone with Political Polls and Research Surveys. Scott Richards CEO

Ocean Express Procedure: Quote and Bind Renewal Cargo

GOZO COLLEGE. Boys Secondary Victoria - Gozo, Malta Ninu Cremona. Half Yearly Examination

User guide. Bluetooth Keyboard BKB10

Programming Block C. Today s Topics. wstomv/2ip05/ Lecture 13. Implement an ADT, given its contract.

SYNTAX DIRECTED TRANSLATION FOR CONTROL STRUCTURES

History. used in early Mac development notable systems in Pascal Skype TeX embedded systems

Verification and Validation

Verification and Validation

Beginning Programming (Pascal) Lecture 75. Figure 1. type-declarations. simple-type. pointer-type. array-type. file-type. set-type.

Today s Topics. Team Project Introduce this year s team project. S/SL S/SL, the Syntax/Semantic Language. CISC 458 Winter J.R.

Using the Document Camera. Features of Interest During Operation

Getting Started With Pascal Programming

x= suppose we want to calculate these large values 1) x= ) x= ) x=3 100 * ) x= ) 7) x=100!

2018 NSP Student Leader Contact Form

Chapter 14. Random Numbers

DelphiScript Keywords

VHDL par Ahcène Bounceur VHDL

Accommodating Broadband Infrastructure on Highway Rights-of-Way. Broadband Technology Opportunities Program (BTOP)

Hash Table. A hash function h maps keys of a given type into integers in a fixed interval [0,m-1]

1 PORT HARDENED SERIAL SERVER

REFERENCE MATERIALS. Assignment, Display, and Input Evaluates expression and assigns the result to the variable a.

CostQuest Associates, Inc.

Concours Informatique Luxembourgeois 2006 Epreuve de Sélection Préliminaire

About Transferring License Rights for. PL7 V4.5 and Unity Pro V2.3 SP1 Software

C-DIAS Analogue Output Module CAO 082 for eight ±10V DC respectively eight 0 20mA DC outputs

<?php. file_get_contents( cours.txt ) /* Persistance côté serveur */ /* */

2018 Supply Cheat Sheet MA/PDP/MAPD

Project Design. Error Format

Credit Cards. Validating Credit Cards. Answers

Parallel Algorithms. Parallel Algorithms

CS240 Fall Mike Lam, Professor. Recurrences

Problem Set CVO 103, Spring 2018

Tutorial 4: Flow Artificial Intelligence

EcoView 8 DO Module Installation and Commissioning

IT Modernization in State Government Drivers, Challenges and Successes. Bo Reese State Chief Information Officer, Oklahoma NASCIO President

Blackboard MRD5 User Manual

CSE 781 Data Base Management Systems, Summer 09 ORACLE PROJECT

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Graphes: Manipulations de base et parcours

ASR Contact and Escalation Lists

Denotational Semantics

SunVTS Quick Reference Card

Flow Chart. The diagrammatic representation shows a solution to a given problem.

MARK SCHEME for the October/November 2013 series 9691 COMPUTING. 9691/21 Paper 2 (Written Paper), maximum raw mark 75

State HIE Strategic and Operational Plan Emerging Models. February 16, 2011

Team Members. When viewing this job aid electronically, click within the Contents to advance to desired page. Introduction... 2

Transcription:

Propositions de correction Bac Pratique informatique 4 scientifiques -27 mai 2014-8h Program BP_2014_27_Mai_8H; uses wincrt; Type Tab=Array[1..50] of integer; VAR T1,T2:Tab; N1,N2,N,M,A1,A2:integer; Procedure Saisie( N,M:integer); write('donner N et M : '); readln(n,m); Until(n>=10) and (N<=M) and (M<=999); Function Som_Diviseur(x:integer):integer; i,s:integer; S:=0; For i:=1 to( x div 2) do if( x MOD i= 0)then S:=S+i; Som_Diviseur :=S; Procedure Remplissage( T:Tab; Taille:integer;x:integer); Taille :=1; T[1] :=x; Taille :=Taille+1; T[Taille] :=Som_Diviseur(T[Taille-1]); Until (T[Taille] = T[Taille-1])OR (T[Taille] = 1); Procedure Affichage(T:Tab;N:integer); Page 1

For i:=1 to N do write(t[i],' '); Function Recherche(T:Tab;N,x:integer):Boolean; i:=1; While(i<=N) and (T[i] <> x) do i:=i+1; Recherche :=(i<=n); Function NB_Commun(T1,T2:Tab;N1,N2:integer):integer; i,nb:integer; NB:=0; For i:=1 to N1 do if(recherche(t2,n2,t1[i]))then NB:=NB+1; NB_Commun:=NB; BEGIN Saisie(N,M); Remplissage(T1,N1,N); Remplissage(T2,N2,M); A1:=-1; if(t1[n1]-t1[n1-1] = 0)then writeln('les termes de la suite de ',N,' ne forment pas une suite aliquote') else writeln('les termes de la suite de ',N,' forment une suite aliquote') ; Affichage(T1,N1); A1:=1; writeln; Page 2

A2:=-1; if(t2[n2]-t2[n2-1] = 0)then writeln('les termes de la suite de ',M,' ne forment pas une suite aliquote') else writeln('les termes de la suite de ',M,' forment une suite aliquote') ; Affichage(T2,N2); A2:=1; writeln; if(a1=1) and (A2=1)then writeln('le nombre des termes communs ebntre ces deux suites aliquotes = ',NB_Commun(T1,T2,N1,N2)); END. Page 3

Program Mardi27Mai2014_9H30; uses wincrt; ch:string; Propositions de correction Bac Pratique informatique 4 scientifiques -27 mai 2014-9h30 (**************************************************************************) Function NB_Arobe(ch:String):integer; i,nb:integer; NB:=0; For i:=1 to Length(ch) do if(ch[i] = '@')then NB:=NB+1; NB_Arobe :=NB; (**************************************************************************) Function Valide(ch:String):Boolean; V1,V2:Boolean; i:=1; V1:=True; While(i<=Length(ch)) and(v1=true) do if(upcase(ch[i]) in ['A'..'Z','0'..'9','@','_','-','.'])then i:=i+1 else V1:=False; V2:= Not((ch[POS('@',ch)-1] in ['_','-','.'])); Valide := (V1) and (V2) and (NB_Arobe(ch) = 1); (**************************************************************************) Procedure Saisie( ch:string); Page 4

write('@ Mail : '); readln(ch); Until(upcase(ch[1]) in ['A'..'Z']) and (Valide(ch)); (**************************************************************************) Function Mot_de_passe(ch:String):String; Motpass:String; MotPass:=Copy(ch,1,POS('@',ch)-1)+ch[POS('@',ch)+1]+ch[Length(ch)]; Mot_de_passe:=Motpass; (**************************************************************************) BEGIN Saisie(ch); writeln('mot de passe : ',Mot_de_passe(ch)); END. Page 5

Propositions de correction Bac Pratique informatique 4 scientifiques -27 mai 2014-11h Program Mardi_27_MAI_2014_11H; uses wincrt; TYPE Tab = Array[1..40] of integer; VAR T,V:Tab; NT,NV :integer; Procedure Saisie ( N:integer); write('taille du tableau [5..40]: '); readln(n); Until(N in [5..40]); Procedure Remplissage( T:Tab;N:integer); For i:=1 to N do write('t[',i,'] = '); readln(t[i]); Until(T[i] > 0); Function Suite(n:integer):integer; i,u:integer; U:=1; For i:=1 to n do U:=3*U-1; Suite :=U; Page 6

Function Appartient(x:integer):boolean; i:=-1; i:=i+1; Until(Suite(i) >= x); Appartient :=(Suite(i) = x); Procedure Transfert(T:Tab; V:Tab;NT:integer; NV:integer); NV:=0; For i:=1 to NT do if(appartient(t[i]))then NV:=NV+1; V[NV] :=T[i]; Procedure Affichage(V:Tab;NV:integer); if(nv=0)then writeln('aucun élément de T ne correspond à un terme de la suite U') else write(v[1],' '); For i:=2 to NV do if(v[i] <>V[i-1])then write(v[i],' '); Page 7

Procedure Trier( T:Tab;N:integer); i,aux:integer; permut:boolean; Permut :=False; For i:=1 to (N-1) do if(t[i]>t[i+1])then Aux :=T[i]; T[i]:=T[i+1]; T[i+1]:=Aux; Until(Permut = False); BEGIN Saisie(NT); Remplissage(T,NT); Transfert(T,V,NT,NV); Trier(V,NV); Affichage(V,NV); END. Page 8

Propositions de correction Bac Pratique informatique 4 scientifiques -27 mai 2014-14h Program Mardi_27_Mai_2014_14H; uses wincrt; A,B:Longint; (***************************************************) Procedure Saisie( A,B:longint); write('bornes de l''intervalle (>=100 : '); Readln(A,B); Until(A>=100) and (A<B); (***************************************************) Function Polydivisible (N:Longint):Boolean; i,e:integer; x:longint; Poly:Boolean; ch,test:string; i:=2;str(n,ch); Test:=Ch[1]+ch[2]; VAL(Test,x,e);Poly:=True; while(i<=length(ch)) and (poly=true) do if(x MOD i = 0)then i:=i+1; Test:=Test+ch[i]; VAL(Test,x,e); end else Poly:=False; Polydivisible :=Poly; Page 9

(***************************************************) Procedure Affichage(A,B:longint); i:longint; For i:=a to B do if(polydivisible(i))then BEGIN writeln(i); READLN; (***************************************************) (***************************************************) BEGIN Saisie(A,B); Affichage(A,B); END. Page 10