Math Programs

 

 

  1. Write a Console Application Program in C#, that will allow the user to enter any float number in the Main method and then use separate methods to find the number’s absolute value, ceiling, floor, sine, cosine, tangent, square root, the number to the third power, and which number is larger (the number entered or pi). Compute the math in the subsequent methods and return them and print each one in the main. Use the following layout:

     

      Please enter a real number: -12.56

 

      Absolute Value:                        12.56     (Math names: column1, results: column 20)

      Ceiling:                         -12.00  and so forth.

 

  1. Write a Console Application Program in C# to find how many days you have been alive! Allow the user to enter 6 numbers: Today’s Date and Birth Date (Use numeric months). Don’t forget to figure in leap years. Use 30 days for months. Use 365 for non-leap years. The Main Method should simply initialize the variables and call the methods. The first method should input the 7 values, the second method should do the math calculations, and the third method should print the results. Use the following layout:

 

      Please enter name: Corinne

      Please enter today’s month: 9

      Please enter today’s day: 25

      Please enter today’s year: 2002

      Please enter birth month: 8

      Please enter birth day: 16

      Please enter birth year: 1961

 

      Corinne, you have been alive for 15014 days and over 10 leap years.


3. What is the ASCII number 72 in Binary? ______________

                                                     in Octal?   ______________

                                                     in Hexadecimal? _________

 

4.   What is the ASCII number 141 in Binary? ______________

                                                     in Octal?   ______________

                                                     in Hexadecimal? _________