1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MArishka [77]
2 years ago
14

Design and implement a program (name it SumValue) that reads three integers (say X, Y, and Z) and prints out their values on sep

arate lines with proper labels, followed by their average with proper label. Comment your code properly. Format the outputs following the sample runs below.
Sample run 1:
X = 3
Y = 2
Z = 4
Average = 3.0
Sample run 1:
X = 7
Y = 8
Z = 10
Average = 8.333333333333334
Sample run 1:
X = 7
Y = -3
Z = -5
Average = -0.3333333333333333
Chemistry
1 answer:
rjkz [21]2 years ago
3 0

Answer:

class sum (

public static void sumofvalue (int m, int n, int p)

{

System.out.println(m);

System.out.println(n);

System.out.println(p);

int SumValue=m+n+p;

System.out.println("Average="+Sumvalue/3);

}

)

Public class XYZ

(

public static void main(String [] args)

{

sum ob=new sum();

int X=3;

int X=4;

int X=5;

ob.sumofvalue(X,Y,Z);

int X=7;

int X=8;

int X=10;

ob.sumofvalue(X,Y,Z);

}

)

Explanation:

The above program is made in Java, in which first we have printed value in a separate line. After that, the average value of those three values has been printed according to the question.

The processing of the program is given below in detail

* The first one class named 'sum' has been created which contains the function to print individual value and the average of those three values.

* In seconds main class named 'XYZ', the object of that the above class had been created which call the method of the above class to perform functions.

* In the main class values are assigned to variables X, Y, Z.

You might be interested in
Psychologist work with "neurotics" more<br> than psychotics.<br> A-True<br> B-False
dexar [7]
It would be FALSE!!!
3 0
3 years ago
Which statement is true?
Elena-2011 [213]
The letter only has reflection symmetry, if you rotated it it would look the same.
4 0
2 years ago
What is photosynthesis?
tamaranim1 [39]
<span>the process by which green plants and some other organisms use sunlight to synthesize foods from carbon dioxide and water. Photosynthesis in plants generally involves the green pigment chlorophyll and generates oxygen as a byproduct.

</span>
7 0
3 years ago
The correct labels for the numbers in Figure 7-1 are (1) ____________________, (2) ____________________, and (3) _______________
Scrat [10]

Answer:

A horizon, B horizon, C horizon .

6 0
3 years ago
Are the answers correct? if not please help fix them
Serggg [28]

Answer:

Looks like they're all right

8 0
2 years ago
Other questions:
  • How do you convert 3.9mL to hL
    11·1 answer
  • CaCO3(s) + HCl → CaCl2(s) + CO2(g) + H2O(g)
    15·1 answer
  • What happens to the molecules within a gas when the gas condenses
    8·1 answer
  • What does multivalent mean???
    9·1 answer
  • What is the number of protons in this carbon atom? 12 6 18 24
    15·2 answers
  • Explain obser made when flourine is bubbled in bromine water for sometime
    12·1 answer
  • calculate the mass of sodium trioxocarbonate(iv) produced by the complete decomposition of 16.8g of sodium hydrogen trioxocabona
    13·1 answer
  • What effect has impurities on the melting and boiling points of pure substances? illustrate your answer with an example
    11·1 answer
  • Air bags are activated when a severe impact causes a steel ball to compress a spring and electrically ignite a detonator cap. Th
    5·1 answer
  • 4.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!