Functional Programming.docx

# Functional Programming.docx - 1 Functional Programming Adam...

• 4

This preview shows page 1 - 3 out of 4 pages.

1 Functional Programming Adam Lowery CYB/130 Anastasia Jakubow Day 7

Subscribe to view the full document.

2 Individual: Functional Programming This script demonstrates the concept of functional programming, by creating three  functions: faherenheit2Celsius(), a function that converts temperatures in the Fahrenheit scale to  Celsius, celsius2Faherenheit(), a function that converts temperatures in the Celsius scale to  Fahrenheit, and scale Select(), which allows the user to choose the starting scale.  The formula  used for the conversion is F = 1.8C+32, where F is Fahrenheit and C is Celsius.  The assignment  calls for the script to be tested by converting 32 degrees Fahrenheit to Celsius and back, to  ensure the output is correct, and to find temperatures at which the conversion does not reverse  correctly. (Fig 1-1) Figure 1-1 shows the script performing the conversion of 32 degrees Fahrenheit to  Celsius, which equals 0 degrees C, and back, which correctly returns 32 degrees F.
• Winter '18

{[ snackBarMessage ]}

###### "Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern