Question
Need Help With The TODO Numbers
Tools Configure Window Help Edit View Project Build Run BB9- Projectl_NumberCalculationsja... X public static void main(Strin
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Java code:

import java.util.*;
public class Main
{
   public static void main(String[] args) {
       Scanner s = new Scanner(System.in);
       int number1;
       int number2;
       int number3;
       int largest;
       int smallest;
       int sum;
       int product;
       int average;
       System.out.print("Enter Number 1:");
       number1 = s.nextInt();
       System.out.print("Enter Number 2:");
       number2 = s.nextInt();
       System.out.print("Enter Number 3:");
       number3 = s.nextInt();
       sum = number1 + number2 + number3;
       product = number1 * number2 * number3;
       average = (int)sum/3;
       smallest = Math.min(number1,Math.min(number2,number3));
       largest = Math.max(number1,Math.max(number2,number3));
       System.out.println("Largest Number is :"+largest);
       System.out.println("Smallest Number is :"+smallest);
       System.out.println("Sum of 3 numbers is :"+sum);
       System.out.println("Average of 3 numbers is :"+average);
       System.out.println("Product of 3 numbers is :"+product);
   }
}
Execution screenshot:

Main.java 1 import java.util.*; 2 public class Main 3- { public static void main(String[] args) { Scanner s = new Scanner(SysNote: Please like the answer. Thank you. Have a nice day.

Add a comment
Know the answer?
Add Answer to:
Need Help With The TODO Numbers Tools Configure Window Help Edit View Project Build Run BB9-...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I have a java project that I need help trying to finish. I have most of it completed but the issue I am running into is adding numbers with different lengths. Project requirements: . Use a Stack ADT w...

    I have a java project that I need help trying to finish. I have most of it completed but the issue I am running into is adding numbers with different lengths. Project requirements: . Use a Stack ADT with the implementation of your choice (Array or Link), it should not make a difference 2.Read two “integer” numbers from the user. Hint: You don’t need to use an int type when you read, it may be easier to parse the input...

  • Python Script format please! 1. Write a script that takes in three integer numbers from the...

    Python Script format please! 1. Write a script that takes in three integer numbers from the user, calculates, and displays the sum, average, product, smallest, and largest of the numbers input. Important things to note: a. You cannot use the min() or max() functions, you must provide the logic yourself b. The calculated average must be displayed as an integer value (ex. If the sum of the three values is 7, the average displayed should be 2, not 2.3333). Example:...

  • 1. Import file ReadingData.zip into NetBeans. Also, please download the input.txt file and store it into...

    1. Import file ReadingData.zip into NetBeans. Also, please download the input.txt file and store it into an appropriate folder in your drive. a) Go through the codes then run the file and write the output with screenshot (please make sure that you change the location of the file) (20 points) b) Write additional Java code that will show the average of all numbers in input.txt file (10 points) import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import java.io.*; 1- * @author mdkabir...

  • need help editing or rewriting java code, I have this program running that creates random numbers...

    need help editing or rewriting java code, I have this program running that creates random numbers and finds min, max, median ect. from a group of numbers,array. I need to use a data class and a constructor to run the code instead of how I have it written right now. this is an example of what i'm being asked for. This is my code: import java.util.Random; import java.util.Scanner; public class RandomArray { // method to find the minimum number in...

  • Need help with the UML for this code? Thank you. import java.util.Scanner;    public class Assignment1Duong1895...

    Need help with the UML for this code? Thank you. import java.util.Scanner;    public class Assignment1Duong1895    {        public static void header()        {            System.out.println("\tWelcome to St. Joseph's College");        }        public static void main(String[] args) {            Scanner input = new Scanner(System.in);            int d;            header();            System.out.println("Enter number of items to process");            d = input.nextInt();      ...

  • In this lab, you complete a partially written Java program that includes two methods that require...

    In this lab, you complete a partially written Java program that includes two methods that require a single parameter. The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a method that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another method that computes the product of all the whole numbers up to...

  • In this lab, you complete a partially written Java program that includes two methods that require...

    In this lab, you complete a partially written Java program that includes two methods that require a single parameter. The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a method that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another method that computes the product of all the whole numbers up to...

  • Hi I need some help on this lab. The world depends on its successfull compilation. /*...

    Hi I need some help on this lab. The world depends on its successfull compilation. /* Lab5.java Arrays, File input and methods Read the comments and insert your code where indicated. Do not add/modify any output statements */ import java.io.*; import java.util.*; public class Lab5 { public static void main (String[] args) throws Exception { final int ARRAY_MAX = 30; // "args" is the list of tokens you put after "java Project3" on command line if (args.length == 0 )...

  • Please help and please satisfy the directions. The directions are under program 3. port JavaScore. public...

    Please help and please satisfy the directions. The directions are under program 3. port JavaScore. public class Example 4 [ public static int getint String strum - JOptionPane.showinput Dialog("Enter an integer"); return integer.parseInt(strum): public static void main(String args Scanner input = new Scanner (System.in): System.out.println("Enter 2 integers"); intx input.nextInt(); inty input.nextInt(): 1/ these are simple is if b ) System.out.println("The first number is positive): if (0 y0) System.out.println("Both numbers are positive"); ( 11 y) System.out.println("At least one number is positive");...

  • Write a Python Program Preview File Edit View Go Tools Window OO 95% Help An Intro...

    Write a Python Program Preview File Edit View Go Tools Window OO 95% Help An Intro to Programming Using Python (2) (1) (1).pdf (page 256 of 431) Mon 11:28 AM Q E © Q Search 2. Curve Grades Statisticians use the concepts of mean and standard deviation to describe a collection of numbers. The mean is the average value of the numbers, and the standard deviation measures the spread or dispersal of the numbers about the mean. Formally, if X1,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT