Create a lab12 subdirectory in the 1440 directory of one of the group members. Put all work for lab12 in that subdirectory. As soon as you think you have solved a problem correctly, tell me the name of the file containing the program and I will move it to my directory to check it.
1) Write a program that will take as input a decimal digit, i.e., 0-9, and draw a triangle of the given decimal digit height with each column containing the digit corresponding to the number of digits in the column. For example, if the user enters 5, the following picture would be drawn:
5 54 543 5432 54321
2)Problem 5, p. 437 of your text. Write a program that accepts a year written as a four-digit Arabic (ordinary) numeral and outputs the year in Roman Numerals. Important Roman numerals are: V for 5, X for 10, L for 50, C for 100, D for 500 and M for 1000. Recall that some numbers are formed by using a kind of subtraction of one Roman "digit"; e.g., IV is 4 produced as V minus I, XL is 40, CM is 900, etx. A few sample years: MCM is 1900, MCML is 1950, MCMLX is 1960, MCMXL is 1940, MCMLXXXIX is 1989. Assume the year is between 1000 and 3000.
Enter a four digit number: 5678 5 6 7 8
5) Write a program that asks the user for the number of characters, n, in a string and then asks the user to input that many characters. Finally, the program generates all permutations for the string of length n and outputs each permutation to the screen.
Please enter the number of characters: 3 Please enter a string of length 3: cat Here are the permutations of cat: cat cta tca tac act atc(Hint: The number of permutations of a string is equal to the factorial of the length of the string.)
1) 0 < a < b < c; and
2) c2 = a2 + b2.
Write a program that takes 3 integers as input and reports whether they form a Pythagorean Triple.
Example 1: Enter a: 3 Enter b: 4 Enter c: 5 A Pythagorean Triple. Example 2: Enter a: -3 Enter b: 4 Enter c: 5 Not a Pythagorean Triple.