Jump to content

Recommended Posts

Posted

peste oti exoume auto to code pou ipologizei meso oro:

import java.util.Scanner;

class mxc{
public static void main(String args[])
{
	Scanner keyboard = new Scanner(System.in);
   double total = 0;
   double grade;
   double average;
   int counter = 0;
   int arcana;
   
   System.out.print("Apo posa objects thes na bgaleis to meso oro: ");
   arcana = keyboard.nextInt();
   
   if (arcana==1){
	   System.out.println("Prepei na ine parapanw apo 1!!!!!!!!!, Ksana trekste to programma");
	   return;
   }
   
   System.out.println("Parakalo isagete tous arithmous: ");
   while(counter<arcana)
   {
	   grade = keyboard.nextDouble();
	   total = total +grade;
	   counter++;
   }
   average = total/arcana;
   System.out.println("Average: "+average);
   
}
}

 

Doulevo se eclipse. px omos auto to programma 8elw na to kanw .exe kai na emfanizete otan to trexoun oi aloi ki egw se console . me piasate ti enow pisteuo.mporeis kapios na mou diksei analitika ti tha kanw gia na to kanw ? plz gyes ine anagi

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..