Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SECOND LIST OF EXERCICES
17. Write a program that permits to introduce the
age and the gender of 60 teachers. You must valid
that the gender is “M” or “F”. The age must be
between 18 and 70 years. You have to display how
many men and women there are over 45 years old.
0 <= GRADE < 3 MD
3 <= GRADE < 5 INS
5 <= GRADE < 6 SUF
6 <= GRADE< 7 BIEN
7 <= GRADE < 9 NOT
9 <= GRADE <= 10 SOB
Programing
Course 2011/2012 Pág. 1
Department of Computer Science
21. Do the program that allows to type a number
corresponding to one year and calculate and
display whether it is a leap year or not. (A year
is a leap year if it is a multiple of 4, except
for years that are multiples of 100 and not
multiple of 400).
25. Do the program that enters the names, gender
(M or F), salary (> 500 and <1000) and age (> 18
and <65>) of employees of a company. It must show
how many women earn less than 700 euros, and how
many men earn above 800 euros. Also it must show a
message saying if there is any woman who earns
over 900 euros.
Programing
Course 2011/2012 Pág. 2
Department of Computer Science
27. Do the program that displays the amount that
will be attributed to each winner of the Bonoloto.
You have to introduce the following information:
the amount to be distributed and the number of
winners in each category (3, 4, 5 and 6 hits). You
have to know that each category accounts for 10%,
20%, 30% and 40% of the total amount to be
distributed.
RECURSION
30. The Fibonacci series is a sequence of numbers
where each number is equal to the sum of the two
previous numbers. The first two numbers are 1. You
must to write a program that visualizes the nth
term of the Fibonacci series.
Programing
Course 2011/2012 Pág. 3