On 11/1/11, mc100401719 Fareena Javed <mc100401719@vu.edu.pk> wrote:
> yeh loo cs 506 ka solution note pad pe buna k bhej dyna
> java.io.*;
> public class inputTxt
> {
>
> public static void main(String arg[]){
> FileReader fr=null;
> BufferedReader br=null;
> try{
>
> float avg=0.0;
> //aattaching node stream with data source
>
> fr=new FileReader("input.txt");
>
> //aattaching filter stream over node stream
>
> br=new BufferedReader(fr);
> //read the line form file
> String line=br.readLine();
>
> float number;
> float avg=0.0;
> float sum=0.0;
> float std=0.0;
> float sumSQ=0.0;
> float var=0.0;
> float avgSQ=0.0;
>
> //printing and reading remaining lines
> while(line!=null)
> {
> number= Float.parseFloat(line);
> sum=sum+number;
> sumSQ=sumSQ+number*number;
> line=br.readLine();
> Number++;
> }
>
> System.out.println(sum);
> System.out.println(sumSQ);
> avg=sum/Number;
> avgSQ=sumSQ/Number;
> System.out.println(avg);
> System.out.println(avgSQ);
> var=avgSQ-avg*avg;
> std=math.sqrt(var);
> System.out.println(std);
> System.out.println(var);
> br.close();
> fr.close();
> } //
> catch(IOException ex){
> System.out.println(ioex);
> }
> }
> }
>
>
> On Tue, Nov 1, 2011 at 7:38 PM, mc100404870 Tayyiba Shamsher <
> mc100404870@vu.edu.pk> wrote:
>
>> plllzzzz solution dy dooo koi xtnded day today plzzzzzzz........
>>
>> --
>> Please visit http://www.weblyceum.com and get registered for Past Papers,
>> Quiz, Assignments, GDBs and much more...
>>
>> To post to this group, send email to vu-experts@googlegroups.com
>>
>> To unsubscribe from this group, send email to
>> vu-experts-unsubscribe@googlegroups.com
>>
>> Do write to admin.bilal@weblyceum.com for Help, suggestion and Complaint.
>>
>
> --
> Please visit http://www.weblyceum.com and get registered for Past Papers,
> Quiz, Assignments, GDBs and much more...
>
> To post to this group, send email to vu-experts@googlegroups.com
>
> To unsubscribe from this group, send email to
> vu-experts-unsubscribe@googlegroups.com
>
> Do write to admin.bilal@weblyceum.com for Help, suggestion and Complaint.
>
--
Please visit http://www.weblyceum.com and get registered for Past Papers, Quiz, Assignments, GDBs and much more...
To post to this group, send email to vu-experts@googlegroups.com
To unsubscribe from this group, send email to vu-experts-unsubscribe@googlegroups.com
Do write to admin.bilal@weblyceum.com for Help, suggestion and Complaint.
No comments:
Post a Comment