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
/* 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
/* 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
/* 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
--[[ 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
-- 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
/* 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
/* 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
/* Homework Set 1 Problem 13 by Dillon Morse | |
* ----------------------------------------- | |
* An electronics company sells circuit boards at a 40 percent profit. Write a | |
* program that will calculate the selling price of a circuit board that costs | |
* $12.67. Display the result on the screen. | |
*/ | |
#include<iostream> | |
#include<cmath> | |
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
-- Hole Digger by dillmo -- | |
--[[ | |
This program will dig a hole of your description and place ladders for | |
you. To begin with, place your mining turtle in the bottom left corner of | |
your hole. Be sure to place ladders in slot one of your turtle's | |
inventory and specify configuration variables before beginning. | |
--]] | |
-- Configuration -- | |
local current_height = 70 -- The current y value of your turtle. This should be |