Practice exercise: Problem Solving and Algorithms(7a)

                     
1. Selection
   Develop an "app" to help decide how to dress for the weather:
   The main module tasks are a) output a title, b) prompt and input the 
   temperature; c) determine dress. The abstract step c should associate 
   temperatures above 90 with "sun suit", between 70 and 90 with
   "short sleeves", between 50 and 70 with "sweater", 32 to 50 with 
   "warm coat and mittens", otherwise "dress for staying inside".




   
   
   
   
   
   
2. Repetition (count-controlled)
   Input the number of pairs of values; then input and output each pair placed
   in ascending order. The abstract step placed in ascending order requires
   comparing the values and choosing the lowest one to be first out.

   
   
   
   
   
   
3. Repetition (event-controlled)
   a. Input and sum numbers until 10 positive values have been encountered.
      Output the sum.
   
   
   
   
   
   
   
   
   
   
   b. Convert from base 10 to base 2: prompt and input the decimal number;
      divide the decimal number by 2; output the remainder; replace the
      decimal number with the quotient; repeat the steps if the quotient
      is not zero. (Read the outputs in reverse order.)
   
   
   
   
   
   
   
   c. Find the greatest common divisor (GCD) of two integer numbers(e.g. 12 
      and 8). Divide the larger integer by the smaller integer and if the 
      remainder is zero, the smaller integer is the GCD. If the remainder is 
      not zero, repeat the process after replacing the larger integer with the
      value of the smaller integer and replacing the value of the smaller
      integer with the remainder. Example 12 / 8 --> r = 4;  8 / 4 --> r = 0; 
      thus GCD = 4