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
'''Create a program that asks the user for a number and then prints out a list | |
of all the divisors of that number. (If you don’t know what a divisor is, it | |
is a number that divides evenly into another number. For example, 13 is a | |
divisor of 26 because 26 / 13 has no remainder.) | |
Source:http://www.practicepython.org/exercise/2014/02/26/04-divisors.html | |
''' | |
num = int(raw_input("Enter a number: ")) |
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
/* print out a continent and the largest city in that continent, based on the value of an integer. */ | |
public class Continents { | |
public static void main(String[] args) { | |
int continent =4; | |
switch(continent){ | |
case 1: | |
System.out.println("North America: Mexico City, Mexico"); | |
break; |
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
/*a program that will calculate the monthly car payment a user should expect to make after taking out a car loan*/ | |
public class CarLoan { | |
public static void main(String[] args) { | |
int carLoan = 10000; | |
int loanLength = 3; | |
int interestRate = 5; | |
int downPayment = 2000; | |
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
'''a program that will calculate the monthly car payment a user should expect | |
to make after taking out a car loan*/ ''' | |
def CarLoan(): | |
car_loan = 10000 | |
loan_length = 3 | |
interest_rate = 5 | |
down_payment =2000 |
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
/* a simple arithmetic calculator. */ | |
class Calculator{ | |
public Calculator(){ | |
} | |
public int add(int a, int b){ | |
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
/* A simple Droid (robot) that can be activated, charged, and hover above ground.*/ | |
public class Droid{ | |
int batteryLevel; | |
public Droid(){ | |
batteryLevel =100; | |
} | |
public void activate(){ | |
System.out.println("Activated. How can I help you?"); |
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
/* | |
A simple tool to help analyze classroom grades stored in an ArrayList. At the analyzer is able to retrieve the classroom average. | |
*/ | |
import java.util.ArrayList; | |
public class GradeAnalyzer{ | |
public GradeAnalyzer(){ |
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
/* a simple Library tool to help analyze completed books in a small, personal library | |
*/ | |
import java.util.HashMap; | |
public class Library{ | |
public Library(){ | |
} |
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
const getUserChoice = userInput =>{ | |
userInput = userInput.toLowerCase(); | |
if(userInput === 'rock' || userInput === 'paper' || userInput === 'scissors' ||userInput === 'bomb' ){ | |
return userInput; | |
}else{ | |
console.log('Please enter rock, paper or scissors'); | |
} | |
}; | |
const getComputerChoice =()=> { |
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
misty.Debug("Starting my skill"); | |
let yesnoURL = "https://yesno.wtf/api" | |
// Parse the response data to get the current condition in _params.city | |
// and print this in a string to the dev console in the Skill Runner | |
// web page. | |
function _SendExternalRequest(data) { |
OlderNewer