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
Francis has applied for admission to a computer science program, and one of the requirements for admission is the completion of
Nataly_w [17]

Answer:

an aptitude test.

Explanation:

Based on the scenario being described it can be said that the test that Francis is scheduled to take would be classified as an aptitude test. This is a test that tries to determine an individual's innate ability at a particular competency. These are abilities such as sequencing skills and abstract reasoning skills, and are the results of these tests are used in order to see where a candidate can best be placed within a program/company to best perform.

8 0
3 years ago
Read 2 more answers
Wi-Fi is designed for medium-range transfers, up to ____ feet outdoors. Answer 100 300 500 900
Papessa [141]
Wi-Fi is designed for medium range transfers up to 900 feet out doors. ANSWER: 900 feet
6 0
3 years ago
A Supermarket manager hired one packager who can pack 15 boxes every two minutes. Ater some time the manager noticed that packag
Semenov [28]

Answer:

40mn

Explanation:

500/t=15/2+15/3

500/t=75/6

75t=500×6

t=3000/75

t=40

6 0
2 years ago
Read 2 more answers
What technology uses short-range radio signals to enable computers and devices to communicate with each other.
UkoKoshka [18]

Answer:

i also want to know the answer

Explanation:

3 0
2 years ago
The records in a database table are generally visualized as​ ________.
vekshin1
The records in a database table are generally visualized as rows

Rows should be the answer 
5 0
3 years ago
Other questions:
  • How do you delete text from a slide
    14·2 answers
  • What operating system is an open source program
    15·1 answer
  • Mike has never used a slide software before, but he needs to create a presentation by the end of the week. what recourse would b
    8·1 answer
  • Communication is the transmission of messages to large audiences.
    14·1 answer
  • Differences of a desktop computer and a laptop
    13·1 answer
  • Consider two vectors that are NOT sorted, each containing n comparable items. How long would it take to display all items (in an
    8·1 answer
  • 3. In 1989, the first handheld console was released by _____ and it was called ________.
    13·1 answer
  • _____________are where you get down to business and enter data in a worksheet
    12·1 answer
  • What are the methods of gilding<br><br>nonsense will be immediately reported. ​
    7·1 answer
  • Discovery of a vulnerability in a software program can potentially be sold to the government. Group of answer choices True False
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!