man f*** that guy above me.
we in covid era. im here to help anyone as I would want the same help here you go @op enjoy LIFE!
import java.util.;
import java.io.;
class Program
{
public static void main(String args[])
{
try
{
Scanner sc0=new Scanner(System.in);
System.out.print("\nEnter the file name with extension: ");
String fname=sc0.next();
File f1=new File(fname);
if(f1.exists())
{
if(f1.length()!=0)
{
Scanner sc=new Scanner(f1);
ArrayList nums=new ArrayList();
int c=0;
while(sc.hasNextInt())
{
nums.add(sc.nextInt());
c++;
}
THIS PART 2
int sum=0;
int high=nums.get(0);
int low=nums.get(0);
//to get the highest number
for(int i:nums)
{
if(high<i)
{
high=i;
}
}
//to get the lowest number
for(int i:nums)
{
if(low>i)
{
low=i;
}
}
//to get the sum and the average
for(int i:nums)
{
sum=sum+i;
}
double avg=(double)sum/nums.size();
System.out.printf("\nAverage: %.2f\n",avg);
System.out.println("\nMin: "+low);
System.out.println("\nMax: "+high);
System.out.println("\n");
}
else
{
System.out.println("File has no data.");
}
}
else
{
System.out.println("Invalid file.");
}
}
catch(Exception e1)
{
System.out.println(e1);
}
}
}
man f*** that guy above me.
we in covid era. im here to help anyone as I would want the same help here you go @op enjoy LIFE!
import java.util.;
import java.io.;
class Program
{
public static void main(String args[])
{
try
{
Scanner sc0=new Scanner(System.in);
System.out.print("\nEnter the file name with extension: ");
String fname=sc0.next();
File f1=new File(fname);
if(f1.exists())
{
if(f1.length()!=0)
{
Scanner sc=new Scanner(f1);
ArrayList nums=new ArrayList();
int c=0;
while(sc.hasNextInt())
{
nums.add(sc.nextInt());
c++;
}
damn thank you for the swiftness and kindness. i hope the rest of the year is good for you
damn thank you for the swiftness and kindness. i hope the rest of the year is good for you
Idk wtf I’m lookin at
KTT user asks for help with Computer Science homework, featuring the Java language
If you got a chegg account can you send the solution for
https://www.chegg.com/homework-help/questions-and-answers/67-read-process-varied-amount-input-data-file-statistics-often-calculated-varying-amounts--q55997268
This college level or HS?
college intro just not good with java
Word makes sense I was just curious I haven’t done any coding since AP in HS but this is somewhat familiar it being intro makes sense
Holy s*** the long nights I spent begging someone for code before a deadline
I’ve even made my own threads like this