I need to write an application that reads three intergers and prints their average, 2- write an application that reads two floating point numbers and prints their sum, difference, and product. I am doing programming projects in Java software solutions 5th edition for school.

_______________________-
SEO

Edited 7 Years Ago by gtey: n/a

Get user entered input data from keyboard. Use BufferedReader and InputStreamReader classes to receive the intput data.
Convert user entered String type value to appropriate type value .
compute data and display the result

Comments
be think on problem

what you need is this...
do second one first...
set 2 attributes: double x
double y

methods you should programme are: constructors
getX()
getY()
setX()
setY()
toString()

first one...
create a class with 3 attributes which are all doubles...
create the same as above except in the toString, instead of a list of calculations (pm me if you are unsure about this) seperated with the "\n" aswell as the + signs...just create the sum for average using the 3 inputs.
need any further help then pm me please, as I am beginning to wonder if this forum is a joke due to flamers as theres only one person offered to help me since I joined when I have answered quite some threads for my first day

Edited 7 Years Ago by 0805638: n/a

you can add two integers in java simply by

class javaa
{


}

Edited 3 Years Ago by Reverend Jim: Fixed formatting

class javaa
{ 
double x;
double y;
double z;
javaa(int x,int y,int z)
{
this.x=x;
this.y=y;
this.z=z;
}
double setx()
{
this.x=x;
}
double getx()
{
return this.x;
}
double sety()
{
this.y=y;

}
double gety()
{
return y;
}
double setz()
{
this.z=z;
}
double getz()
{
return this.z;
}
double average()
{
double av;
av=(x+y+z)/3;
return av;


}

}


}
class driver
{
public static void main(String []args)
{
javaa j=new javaa(1,2,3);
j.av();

}
}

Edited 3 Years Ago by Reverend Jim: Fixed formatting

public static void main(String []args)
{
javaa j=new javaa(1,2,3);
j.av();
}

Actually you need to call the average() method because there is no method: [U]av[/U] declared in the class.

Also next time if you want code tags, please click the button labeled [code] ,when you create a new post

Edited 3 Years Ago by Reverend Jim: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.