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
Dynamic disk storage provides the flexibility to logically organize disk space across one or more disk drives.
zhuklara [117]
<span>Dynamic disk storage provides the flexibility to logically organize disk space across one or more disk drives. 
a. True 
b. False</span>
3 0
3 years ago
Assume that name has been declared suitably for storing names (like "Amy", "Fritz" and "Moustafa"). Assume also that stdin is a
aniked [119]

Answer:

void main(){

string name;

printf("Enter Name\n");

stdin("%s",&name);

Printf("\nGreetings %s",name);

}

Explanation:

Here scanf is represented by stdin and we are using that scanner object to read the string value from user.The value which we read are printed in a new line using printf .The format specifier %s in printf is replaced by name variable

3 0
3 years ago
Data is removed at the back of the queue.a) trueb) false
alexdok [17]

Answer:

true

Explanation:

4 0
3 years ago
Select the correct answer from each drop-down menu.
mylen [45]

Answer:

"In a VPN, a computer connects to a server and then changes the Internet Protocol of your computer" -urgurlmarie

Source: brainly.com/question/19665457, -urgurlmarie

Opinion: You're answer is correct, I'll take this step by step but by connecting your PC to an server like OpenVPN, or a paid VPN service such as Nord VPN. You are changing your Internet Protocol of your PC to that servers I.P. Address.

7 0
2 years ago
The _____________________ property controls the text appearing in the title bar on a Windows Form object.
Maslowich

Answer:

The correct answer to the given question is: "Text".

Explanation:

The windows form object is part of the vb.net.The term vb.net is divided into two parts (vb+.net). The term vb stands for visual basic and the .net stands for the network enable technology. It is a language that is not case sensitive. It is an object-oriented programming language like c++, java. It is used for making a wide range of Windows, Web, Mobile, and Office applications. which can be built on the .NET Framework. As we know that vb.net is used for making window applications. when we open windows form there is a two type of form first for the design and second for coding. In the designing page, there is text property. To use this property we display the text into the title bar.

So the correct answer is text.

4 0
3 years ago
Other questions:
  • Python full code not displaying<br>only hello prints
    5·1 answer
  • These devices: monitor, earphone, speakers are examples of what? Input devices Storage devices Output devices All answer are cor
    10·2 answers
  • Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished
    14·2 answers
  • You receive an email from someone who claims to be a representative from your credit card company. The email asks you to click o
    8·2 answers
  • What can act as a buffer against unemployment
    11·1 answer
  • Which of the following is not regression test case? A. A representative sample of tests that will exercise all software function
    10·1 answer
  • Eye wash stations should contain enough water to provide ______ minutes of continuous use
    5·2 answers
  • . What is the relationship between frequency, wavelength and speed of a wave?
    15·1 answer
  • Which of the following is best known as a business network LinkedIn, Facebook, Twitter or Word Press?
    15·1 answer
  • . A wireless ……..is a device used to resolvewireless network connectivity problems.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!