Skip to content

Instantly share code, notes, and snippets.

#include<iostream>
#include<fstream>
using namespace std;
struct car{
int num;
float price,mileage,distance;
int year;
string make,model,color;
@bitwiser
bitwiser / vote.c
Last active August 29, 2015 13:56
#include <stdio.h>
int main ()
{
int num, redctr, bluectr, brownctr, yellowctr, greenctr, purplectr;
redctr = 0, bluectr = 0, brownctr = 0, yellowctr = 0, greenctr = 0, purplectr = 0;
printf("The Many Colors of M&M's Candy\n\n");
printf("1. red\n");
printf("2. blue\n");
printf("3. brown\n");
printf("4. yellow\n");
var $ = function (id) {
return document.getElementById(id);
}
var investmentError=document.getElementById("investment_error");
var rateError=document.getElementById("rate_error");
var yearsError=document.getElementById("years_error");
var calculateClick = function () {
var investment = parseFloat( $("investment").value );
var annualRate = parseFloat( $("rate").value );
<!DOCTYPE html>
<html>
<head>
<title>Future Value Calculator</title>
</head>
<body>
<section>
<h1 id="heading">Future Value Calculator</h1>
import sys
import os.path
def readFile(f):
if not os.path.isfile(f):
print('Provided file doesn\'t exist')
return
fil = open(f)
for line in fil:
f1 = line.split()
#include<iostream>
using namespace std;
void getScore(int &a){
cout<<"Enter score(0-100): ";
cin>>a;
cout<<"You entered: "<<a<<endl;
}
/* Add this code in Number.h */
class Number
{
private:
int val;
public:
Number(int);
bool isPrime();
bool isDivisibleBy(int);
class printCombo{
public static void main(String srgs[]){
int i,j;
String s = "abcde";
for(i=0;i<5;i++){
for(j=0;j<5;j++){
System.out.println(s.charAt(i)+""+s.charAt(j));
}
}
}
#include<iostream>
#include<vector>
using namespace std;
int main(){
cout<<"witness my exciting first use of vectors!\n";
cout<<"Enter as many letter as you like, enter ! to quit.\n";
char ch;
vector<char> v;
#include<iostream>
using namespace std;
/* Part (i) */
struct Rectangle{
int width;
int height;
};