This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Problem Set 2 Question 10 by Dillon Morse | |
* ----------------------------------------- | |
* Write a program that converts Celsius temperatures to Fahrenheit | |
* temperatures. | |
*/ | |
#include<iostream> | |
using namespace std; | |
double get_celsius() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Problem Set 3 Question 12 solution by Dillon Morse | |
* -------------------------------------------------- | |
* A bank charges $10 per month plus the following check fees for a commercial | |
* checking account: | |
* | |
* $0.10 each for fewer than 20 checks | |
* $0.08 each for 20-39 checks | |
* $0.06 each for 40-59 checks | |
* $0.04 each for 60 or more checks | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 3x3 Tunnel by dillmo -- | |
--[[ | |
This program creates a 3x3 lit-up tunnel for as far as you want. To run | |
this program, place your turtle on the bottom row of the middle column of | |
your tunnel wall. Then, place torches in the turtle's first inventory | |
slot and cobblestone is the second slot. Before running the program, be | |
sure to configure the program to meet your needs. | |
--]] | |
-- Configuration -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ Branch Miner by dillmo | |
---------------------- | |
Begin by placing the turtle facing forward two blocks three blocks before | |
the next strip. If you have already started, this is at the end of the | |
last strip. Next, place torches in slot one of the turtle's inventory and | |
cobblestone in the second. Finally, specify your preferences in | |
Customization and run the program. The turtle will continue until it | |
reaches the end of your main tunnel. | |
--]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Lab 4 Solution by Dillon Morse | |
* ------------------------------ | |
* Generate four random number grades between 1 and 100. Then, drop the lowest | |
* grade and issue a letter grade, rounding up. | |
*/ | |
#include <iostream> | |
#include <cstdlib> | |
#include <ctime> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Dillon Morse - ASD Intro to C++ Test 1 Lab Solution | |
* --------------------------------------------------- | |
* Write a program that will input an arbitrary number of people who want to | |
* play on a soccer team. We will not accept more than 20 applicants. | |
* | |
* Now determine how many teams of 11 people on a side can we form? | |
* | |
* Full credit requires that you handle incorrect data. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Problem Set 4 Question 10 solution by Dillon Morse | |
* -------------------------------------------------- | |
* Write a proram that uses nested loops to collect data and calculate the | |
* average rainfall over a period of years. The program should first ask for | |
* the number of years. The outer loop will iterate once for each year. The | |
* inner loops will iterate twelve times, once for each month. Each iteration | |
* of the inner loop will ask the user for the inches of rainfall for that | |
* month. | |
* | |
* After all iterations, the program should display the number of months, the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<cstring> | |
#include<vector> | |
#include<sstream> | |
#include<cstdlib> | |
using namespace std; | |
int main() { | |
vector<string> input, countries, output; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Dwarves and Coins Solution by Dillon Morse | |
* ------------------------------------------ | |
* Several (M) dwarves have found a goblin's chest with N gold coins and have | |
* to divide them. Due to ancient rules governing the allocation of loot to | |
* pirates in order of seniority, the oldest dwarf should get one coin more | |
* than the next oldest dwarf, and so on, so that the youngest dwarf gets M-1 | |
* fewer coins than the oldest dwarf. Additionally, no dwarf has to pitch in | |
* any coins (ie no negative coins to any dwarfs) | |
* | |
* Help the dwarves to divide the coins in this way, or tell them that this is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Introduction to C++ Test 2 Lab solution by Dillon Morse | |
* ------------------------------------------------------- | |
* a) Write a program that will create a file that will contain | |
* the data values: | |
* 4 -9 7 | |
* 1 -1 8 | |
* 7 4 5 | |
* 9 0 -3 | |
* when your program completes. | |
* |