0% found this document useful (0 votes)
2 views2 pages

Java 2018 1

This document is an exam paper for the Programming in Java course at the Centre National de Tele-Enseignement de Madagascar for the academic year 2017/2018. It includes various exercises such as identifying primitive types, displaying results from Java instructions, calculating the area of rectangles, and working with arrays and matrices. The exam is structured to test students' understanding of Java programming concepts and their ability to write code.

Uploaded by

rnandrianina11
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
0% found this document useful (0 votes)
2 views2 pages

Java 2018 1

This document is an exam paper for the Programming in Java course at the Centre National de Tele-Enseignement de Madagascar for the academic year 2017/2018. It includes various exercises such as identifying primitive types, displaying results from Java instructions, calculating the area of rectangles, and working with arrays and matrices. The exam is structured to test students' understanding of Java programming concepts and their ability to write code.

Uploaded by

rnandrianina11
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
CENTRE NATIONAL DE TELE-ENSEIGNEMENT DE MADAGASCAR (CNTEMAD) ‘Année Universitaire : 2017/2018 Département : INFORMATIQUE Licence : RS/BDGL Vendredi 22 Juin 2018 (Aprés-midi) Durée : 03 Heures L3IBDGURS EXAMEN SEMESTRE 1 Programmation JAVA Document interdit Exercice :1 (~~ Donnez deux (2) exemples de type primitif. 7... 4 = Scanner est un type primitif ou type objet i W arr D. GAR Exercice:2 ‘Afficher le résultat des instructions en JAVA ci-dessous : publicstaticvoid main(String{] args) { nem Lanne y Weor (int) = 0; 3< +4) <5 ) 4 for (inti = 6 ~j 7 is T Att) ¢ ; System. [Link] (1); 5) dy y P ) [Link]()7 Exercice : 3 Ecrivez un programme qui calcule'la surface de tous les rectangles dont les dimensions | +: longueur et largeur, varient entre 1 et 5 mi (suivant un pas de 1m). Le code utilisera la boucle For et affichera ensemble des résultats. i Soit le tableau de triplets (x, y, 2) suivant : rk wot x y z (ecu 0 105 } 13 7.5 0 ht [14 6 8 \yS [17 0 10 \ j 15 13 12,5 ’ 0 19 6 i Eerivez un programme qui formalise ce tableau dans une matrice de type tab(x] [y] 2} | puis consultez chacune des cellules afin de déterminer les nombres de valeurs mulles (utlisez la boucle for). ala Exercice: 5 Afficher le résultat des instructions en JAVA ci-dessous : publicstaticvoid main(string{) args) { 7/ TODO Ruto~generatedmethed stub String[] ville = { "Tana", "Diego", "Majunga", "Tamatavi String permut; for (inti-0 ; [Link] ; i++ ){ for (intj = 1 ; j<[Link] + j+#){ if (ville{i}.compareToIgnoreCase(ville[j]) > 0 8&J>i){ permut = ville(ili ville(j] = ville(ils villefi] = permut; > ) for (inti = 0; i<[Link] ; it+){ System. [Link]("#@s\n",ville(i}) + ) m,

You might also like