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<fstream> | |
using namespace std; | |
struct car{ | |
int num; | |
float price,mileage,distance; | |
int year; | |
string make,model,color; |
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 <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"); |
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
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 ); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Future Value Calculator</title> | |
</head> | |
<body> | |
<section> | |
<h1 id="heading">Future Value Calculator</h1> | |
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
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() |
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> | |
using namespace std; | |
void getScore(int &a){ | |
cout<<"Enter score(0-100): "; | |
cin>>a; | |
cout<<"You entered: "<<a<<endl; | |
} |
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
/* Add this code in Number.h */ | |
class Number | |
{ | |
private: | |
int val; | |
public: | |
Number(int); | |
bool isPrime(); | |
bool isDivisibleBy(int); |
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
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)); | |
} | |
} | |
} |
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<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; |
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> | |
using namespace std; | |
/* Part (i) */ | |
struct Rectangle{ | |
int width; | |
int height; | |
}; |