jjf214hw3p4 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* James Feindt jjf214 10/3/10 hw3pa4 Corey Montella 3:10 */ using namespace std; #include<iostream> #include<fstream> #include<cmath> void locate (int&, int&); int main() { double N; int more=0, less=0; cout<<"Enter a number between 1 and 10 for N"<<endl; cin>>N; locate (more, less); cout<<"\nThe value of more is: "<<more<<"\nThe value of less is:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: &quot;&lt;&lt;less&lt;&lt;endl; cout&lt;&lt;&quot;Quotient of more/N (percentage): &quot;&lt;&lt;(more/N)*100&lt;&lt;endl&lt;&lt;endl; system (&quot;pause&quot;); return 0; } void locate (int&amp; more, int&amp; less) { double a; ifstream datain (&quot;testdata.txt&quot;); datain&gt;&gt;a; while (!datain.fail()) { if (a&gt;0.7) more++; else if (a&lt;0.6) less++; datain&gt;&gt;a; } }...
View Full Document

Ask a homework question - tutors are online