Skip to content

Commit 45a7584

Browse files
committed
celsius to fahrenheit 👽
0 parents  commit 45a7584

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## JavaScript Algorithms and Data Structures
2+
3+
This repository contains JavaScript based examples of many popular algorithms and data structures.
4+
5+
An algorithm is a series of step-by-step instructions that describe how to do something.
6+
7+
To write an effective algorithm, it helps to break a problem down into smaller parts and think carefully about how to solve each part with code.
8+
9+
This repository contains JavaScript based examples that will teach you the fundamentals of algorithmic thinking by writing algorithms that do everything from converting temperatures to handling complex 2D arrays.
10+
11+
All of these examples are from FreeCodeCamp's [course](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures).
12+
13+
## Table of contents
14+
15+
- [Basic Algorithm Scripting](#basic-algorithm-scriptting)
16+
- [Convert Celsius to FahrenheitPassed](#convert-celsius-to-fahrenheitPassed)
17+
18+
## Basic Algorithm Scripting
19+
20+
### 1. Convert Celsius to FahrenheitPassed
21+
22+
### Difficulty: Beginner
23+
24+
The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.
25+
26+
You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and assign it the Fahrenheit temperature equivalent to the given Celsius temperature. Use the algorithm mentioned above to help convert the Celsius temperature to Fahrenheit.
27+
28+
---
29+
30+
### Solution
31+
32+
```
33+
function convertToF(celsius) {
34+
let fahrenheit = (celsius * 9) / 5 + 32;
35+
return fahrenheit;
36+
}
37+
38+
convertToF(30);
39+
```

0 commit comments

Comments
 (0)