**Instructions: **Write two small programs:

**dec_to**: This program is an extension of your**dec_to_bin**program. It prompts the user for two numbers: the decimal number to be converted, and the base of the desired conversion (2 for binary, 8 for octal, 16 for hexadecimal).You must use a subroutine to solve this program, one with two parameters which correspond to the two numbers input by the user. Your subroutine should return the result to the main program, which should then print it out.

Below is sample output from my program which I want you to mimic

**exactly**:[voyager solutions]$ dec_to Enter decimal number to convert: 256 Enter base of number for desired conversion: 2 100000000 [voyager solutions]$ dec_to Enter decimal number to convert: 256 Enter base of number for desired conversion: 16 100 [voyager solutions]$ dec_to Enter decimal number to convert: 269 Enter base of number for desired conversion: 16 10D [voyager solutions]$ dec_to Enter decimal number to convert: 68 Enter base of number for desired conversion: 8 104 [voyager solutions]$

**grader**: Extend your**grader**program from**Assignment-1**in the following ways:- Output the median (middlemost grade). If an even number of grades
is provided as input, your program should output the average of
the two middle grades.
For example, if the input contains 48 grades,
the median grade would be the average of the 24th and 25th grades
(after sorting). However, if an odd number of grades is provided as
input, your
program should output the actual middlemost grade. That would be the
25th grade in the case of 49 input grades.
- Output the mode (most frequent grade). If there is a "tie" for
the mode, your program can output whichever one of the "winners" you
want. Your program should also output the number of times the mode
occurred in the input.
- Your program should store all the input in an array. This array
must be passed as a parameter to five different subroutines: &sum,
&min, &max, &median, and &mode.
Hint: Perl's

**sort**does lexicographical sorting by default, which is**not**what you need! Consider "blank-padding" your array in order to make**sort**work for you. - Your program should not use any feature beyond Chapter 5 of your
textbook other than the
**int**function in order to truncate the results of division to an integer result.

> grader < even Average = 76.2916666666667 Min = 13 Max = 100 Median = 83.5 Mode = 73 (4 times) > grader < odd Average = 75.76 Min = 13 Max = 100 Median = 82 Mode = 73 (4 times) >

- Output the median (middlemost grade). If an even number of grades
is provided as input, your program should output the average of
the two middle grades.
For example, if the input contains 48 grades,
the median grade would be the average of the 24th and 25th grades
(after sorting). However, if an odd number of grades is provided as
input, your
program should output the actual middlemost grade. That would be the
25th grade in the case of 49 input grades.

To hand in your assignments, send me one and only one email
with two separate text-file
attachments named as specified above. The **Subject**
line should be **Perl ASSIGNMENT-2**. Please put your name as it
appears in De Anza College records in the body of the message.

Even though I have provided sample input for each program above, you are responsible for the correctness of your program, regardless of the input used. In other words: test, Test, TEST! If your program contains logic errors that would appear only with other input files, you'll still lose points. Sharing test cases with other students is encouraged.