Skip to content

Commit fc86370

Browse files
author
james-mcgregor100
committed
final commit.. found more issues with workbook
1 parent 7cc1403 commit fc86370

File tree

11 files changed

+37
-75
lines changed

11 files changed

+37
-75
lines changed

.DS_Store

0 Bytes
Binary file not shown.

JamesMcGregor_T1A1.pdf

195 KB
Binary file not shown.

Q12.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
```ruby
3+
puts "\nProgram to convert temperature from celcius to fahrenheit"
4+
puts "=========================================================="
5+
sleep(3)
6+
puts "\nTo convert the temperature from celcius to fahrenheit, please type in the temperature in celsius below:"
7+
celsius = gets.chomp.to_i
8+
fahrenheit = (celsius * 9 / 5) + 32
9+
sleep(2)
10+
puts "\nThe answer is: #{fahrenheit} " + "degrees fahrenheit."
11+
```
12+
13+

Q13.rb

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,8 @@
11

2-
#arr = [5, 22, 29, 39, 19, 51, 78, 96, 84]
3-
#i = 0
4-
#while (i < arr.size - 1 and arr[i] < arr[i + 1])
5-
# i += 1
6-
#end
7-
# arr[i], arr[i + 1] = arr[i + 1], arr[i]
8-
#puts arr
9-
10-
#arr = [5, 22, 29, 39, 19, 51, 78, 96, 84]
11-
#i = 0
12-
#while (i < arr.size - 1 and arr[i] < arr[i + 1])
13-
# i = i + 1
14-
#end
15-
# arr[i] = arr[i + 1]
16-
# arr[i + 1] = arr[i]
17-
#puts arr
18-
19-
#```ruby
20-
#num = 0
21-
#
22-
#while num <= 50
23-
# puts "The current number is #{num}. This program will keep running until the number hits 50"
24-
# num += 1
25-
#end
26-
#```
27-
28-
num = 25.to_s
29-
puts num
30-
num.object_id?
2+
arr = [5, 22, 29, 39, 19, 51, 78, 96, 84]
3+
i = 0
4+
while (i < arr.size - 1 and arr[i] < arr[i + 1])
5+
i += 1
6+
end
7+
arr[i], arr[i + 1] = arr[i + 1], arr[i]
8+
puts arr

Q14.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
#Demonstrate your algorithmic thinking through #completing the following two tasks, in order:
2-
#1. Create a flowchart to outline the steps for listing #all prime numbers between 1 and 100(inclusive). Your #flowchart should make use of standard conventions for #flowcharts to indicate processes, tasks, actions, or #operations
3-
#
4-
#2. Write pseudocode for the process outlined in your #flowchart
5-
6-
71
require 'prime'
82
arr = []
93
max = 100

Q16.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
```ruby
21

32
skills = {"python" => 1, "ruby" => 2, "bash" => 4, "git" => 8, "html" => 16, "tdd" => 32, "css" => 64, "javascript" => 128}
43
update = Hash.new
@@ -99,4 +98,3 @@
9998
end
10099

101100
puts "\n\nThank you for taking our quiz. We will be in contact with you within the next two weeks to inform you if your application was successful or not."
102-
```

flowchart.drawio

Lines changed: 0 additions & 1 deletion
This file was deleted.

grumpy-cat-attribute-small.png

-7.86 KB
Binary file not shown.

grumpy-cat-small.png

-8.13 KB
Binary file not shown.

readme.md

Lines changed: 17 additions & 37 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)