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
NemiM [27]
3 years ago
10

Java Eclipse homework. I need help coding this|

Computers and Technology
1 answer:
mezya [45]3 years ago
5 0

import java.util.Scanner;

import java.util.Arrays;

public class MyFamily {

   public static void main(String[] args) {

       float avg = 0;

       int smallest = 0;

       int largest = 0;

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter the name of a friend or family member.");

       String name1 = scan.nextLine();

       System.out.println("Enter "+name1+"'s age");

       int name1Age = scan.nextInt();

       System.out.println("Enter the name of a friend or family member.");

       String name2 = scan.next();

       System.out.println("Enter "+name2+"'s age");

       int name2Age = scan.nextInt();

       System.out.println("Enter the name of a friend or family member.");

       String name3 = scan.next();

       System.out.println("Enter "+name3+"'s age");

       int name3Age = scan.nextInt();

       int[] ages = {name1Age, name2Age, name3Age};

       Arrays.sort(ages);

       System.out.println("The oldest is " + ages[2] + " years old");

       System.out.println("The youngest is " + ages[0] + " years old");

       System.out.println("The average is (("+name1Age + "+" + name2Age + "+" + name3Age+") / 3) = " + ((name1Age + name2Age + name3Age) / 3) + " years old");

       System.out.println(name1+", "+name1Age + " years old");

       System.out.println(name2+", "+name2Age + " years old");

       System.out.println(name3+", "+name3Age + " years old");

       

   }

   

}

I hope this helps!

You might be interested in
Which bird is used as the official mascot to the linux operating system?
Nataliya [291]

Answer:

Penguin is used as the official mascot to the linux operating system

6 0
4 years ago
Read 2 more answers
How do you print black and white on the ink Canon Pixma/TS3122?
Paha777 [63]

Answer:

If this printer can connect to a device wirelessly, then you can configure it through our mobile device. If not , try to click either the button above the yellow lights or below and see if that works.

5 0
3 years ago
Should I learn Python, C++, C# or VB to start off programming games for Windows. Open to other language recommendations as well!
Svetllana [295]
In theory, you can of course use any language you like, but there are a few commonly used ones.
From your list it would be c++ or c#, because if you actually have the interest long term then those will be the languages used by the various "big"/well known/used engines.
I would suggest c#, because it can be used with the Unity engine, which has an enormous community with help resources especially to start out and learn to program or game development.
On the other hand I would also suggest JavaScript. It isn't used for any of the big title development, but for all the *.io games like slither and so on. When looking at such games you will quickly notice that they are generally much simpler (for example 2D not 3D), because game engines are just simpler in JavaScript. While this is obviously limiting it might help to get something simple actually working, instead of getting stuck in extra complexities and additional features until you lose your motivation.
The basic programming you learn is still the same, so after you have learned a language you can quickly pick up most others.
<span />
7 0
3 years ago
Pls help!!!!! I need these questions
g100num [7]

Answer:

online identity for the first one and none of the above for the second one:)

8 0
3 years ago
Read 2 more answers
Click this link to view O'NET's Work Styles section for Veterinarians.
Tcecarenko [31]

Answer:

critical thinking, judgment and decision making, speaking, active listening, and science

Explanation: just took the test on edge

3 0
4 years ago
Read 2 more answers
Other questions:
  • Float in is an example of a(n) _____. annotation, evolution, animation, simulation
    14·1 answer
  • What does Mishler mean by the foreground-background interaction? How can this affect the photographs, based on the examples in t
    14·2 answers
  • Why is updating your anti-virus a good thing?
    13·1 answer
  • What do commercial websites use to estimate a visitor's age, gender, and zip code?
    10·1 answer
  • "In a(n) _____ file, each alphabetic, numeric, or special character is represented with a 7-bit binary number."
    12·1 answer
  • Write the Flowchart to find Even number between 1 to 50<br>​
    9·1 answer
  • Select the correct answer.
    9·1 answer
  • Pleaseeee Help.
    8·2 answers
  • A programmer has a need to round many numeric values to the nearest integer. Which of the following best explains the benefit of
    8·1 answer
  • Lists Five Examples of simple statement<br>​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!