need a c++ code which is related to nature

Jan 22, 2013 at 6:15pm
guys i need a c++ programming code which is related to nature ..... give me a code to find the annual amount of rainfsll ?
Jan 22, 2013 at 6:40pm
Place a std::vector<raindrop> outside in an ideal location for collecting raindrops for a year. At the end of the year divide number of drops by the number of days per year and you have your answer in raindrops per day.
Jan 22, 2013 at 6:42pm
Lol ^

Srry if this is spam
Last edited on Jan 22, 2013 at 6:42pm
Jan 23, 2013 at 3:59am
wow
Jan 23, 2013 at 4:08am
lol.
Jan 23, 2013 at 4:34am
realistically, you could find a site that hosts this information, and then make a program that fetches and displays the data.
Jan 23, 2013 at 4:40am
closed account (18hRX9L8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

int main(void)
{
	double inofrain;
	
	std::cout<<"How many inches of rain have fallen last year?  ";
	std::cin>>inofrain;
	std::cin.ignore();
	
	std::cout<<std::endl<<"It rained an average of "<<inofrain/365<<" a day last year.";
	std::cout<<std::endl<<"It rained an average of "<<(inofrain/365)/24<<" a hour last year.";
	std::cout<<std::endl<<"It rained an average of "<<((inofrain/365)/24)/60<<" a minute last year.";
	std::cout<<std::endl<<"it rained an average of "<<(((inofrain/365)/24)/60)/60<<" a second last year.";
	
	std::cout<<std::endl<<std::endl<<"Press \'enter\' to continue...";
	std::cin.ignore();
	return(0);
}


Is this fine?

EDIT: Oh you want it like a rain catcher? Okay so make a rain catcher. Then create a robot with a laser that measures light speed. Then write a program to move the robot across the rain catcher. Count the number of seconds until the speed of light returns to the speed of light in air (not in water). Then do simple calculations with the seconds to get inches of rain. Save this in a text document. Save the time also. When time info year is next year, add total to document and display it on a LED panel.
Last edited on Jan 23, 2013 at 4:45am
Topic archived. No new replies allowed.