jbo214hw3p4 -...

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

View Full Document Right Arrow Icon
/* Joshua Okrent LIN: 819710517 October 4, 2010 HW 1 Khadija Benjlali Section 12 */ using namespace std; #include<iostream> #include<fstream> #include<cmath> #include<iomanip> void locate(double&, int&); int main() { int n; int less=0; double more=0,quotient; cout<<"Enter a value for N between 1 and 10"<<endl; cin>>n; if(n>=10|| n<=1) {cout<<"\nInvalide value. End program."<<endl<<endl<<endl;} else{ locate(more, less);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout<<"More: "<<more<<endl; cout<<"Less: "<<less<<endl; quotient=(more/n*100); cout<<"Quotient (percentage): "<<quotient<<"%"<<endl<<endl;} system("pause"); return 0; } void locate(double& more, int& less) { ifstream datain("testdata.txt"); int counter=0; double x; while(counter<10) { datain>>x; if(x>0.7) {more++;} else if (x<0.6) {less++;} counter++; } }...
View Full Document

Ask a homework question - tutors are online