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
Jobisdone [24]
1 year ago
6

A program is required to three (3) numbers. calculate and print their total

Computers and Technology
1 answer:
podryga [215]1 year ago
5 0

A program that is required to three (3) numbers. calculate and print their total is given below:

<h3>The Program</h3>

import java.util.Scanner;

public class SumAndAverage {

public static void main(String[ ] args) {

System.out.println("Enter three numbers - ");

// Accepting and finding sum of numbers.

int sum = 0;

Scanner sc = new Scanner(System.in);

for (int i = 0; i < 3; i++)

sum += sc.nextInt( );

// Printing sum and average.

System.out.println("Sum - " + sum);

System.out.println("Average - " + (sum / 3f));

}

}

The output would request three different numbers, then add them up, and display the output of the sum and then display or print their total


Read more about programming here:

brainly.com/question/23275071

#SPJ1

You might be interested in
Use the distributive property to expand the following expression. (9m - 6)7
Nady [450]
(9m - 6)7
(9m × 7) - (6 × 7)
63m - 42
7 0
3 years ago
Read 2 more answers
Siltstone is made mostly of _____.<br><br> A : silt<br> B : sand<br> C : shells<br> D : gravel
frez [133]
The best and most correct answer among the choices provided by the question is the second choice. <span>Siltstone is made mostly of silt. </span>I hope my answer has come to your help. God bless and have a nice day ahead!
6 0
3 years ago
Read 2 more answers
in java how do i Write a method named isEven that accepts an int argument. The method should return true if the argument is even
Veseljchak [2.6K]
<h2>Answer:</h2><h2>============================================</h2>

//Class header definition

public class TestEven {

   

   //Method main to test the method isEven

   public static void main(String args[ ] ) {

       

       //Test the method isEven using numbers 5 and 6 as arguments

       System.out.println(isEven(5));

       System.out.println(isEven(6));

     

   }

   

   //Method isEven

   //Method has a return type of boolean since it returns true or false.

   //Method has an int parameter

   public static boolean isEven(int number){

       //A number is even if its modulus with 2 gives zero

      if (number % 2 == 0){

           return true;

       }

       

       //Otherwise, the number is odd

       return false;

   }

}

====================================================

<h2>Sample Output:</h2>

=========================================================

false

true

==========================================================

<h2>Explanation:</h2>

The above code has been written in Java. It contains comments explaining every part of the code. Please go through the comments in the code.

A sample output has also been provided. You can save the code as TestEven.java and run it on your machine.

3 0
3 years ago
Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he o
Dmitriy789 [7]

Answer:

The solution code is written in Python 3

  1. count = 0
  2. sum = 0
  3. num = input("Enter a number: ")
  4. while(num != ''):
  5.    sum += float(num)
  6.    count += 1
  7.    num = input("Enter a number: ")
  8. print("Sum : " + str(sum))
  9. print("Average: " + str(sum / count))

Explanation:

Firstly, we declare two variables count and sum to hold the number of input number and the total of the input number, respectively (Line 1-2)

Next, we prompt user to input the first number (Line 4). While the num is not ' ' (This means it is not "Enter" key), accumulate the num to sum variable and increment count by one (Line 6-8) and then prompt the user to input the next number (Line 9).

At the end, display the sum and average using print function (Line 11 -12).

5 0
3 years ago
Which model works on the idea that advertising motivates people to think about the message, feel something about the product, an
Ganezh [65]

Answer:

D. Think-Feel-Do Model

Explanation:

The Think-Feel-Do Model or simply just TFD model is a marketing model used by marketers to engage their target customers.

THINK - Involves the marketers having an insights into the target customer's needs that are important.

FEEL - Understanding the target customers basic drive. It involves inbound and outbound marketing communications.

DO - This involves the creation of marketing materials to be used in targeting the target customers for the products/services.

7 0
3 years ago
Other questions:
  • Which company provides the Loki Wi-Fi mapping service?
    10·1 answer
  • How can a wiki contribute to an academic paper?
    9·2 answers
  • The mobile nodes (devices) add or leave a Mobile Ad-hoc Network, changing the _____ of this network over time. a) infrastructure
    14·1 answer
  • Explain why there is an overlap of skills and qualities in design professions​
    14·1 answer
  • A town government is designing a new bus system. The planners are deciding where to put the different bus stops. They want to pi
    6·2 answers
  • Write an application that allows a user to input the height and width of a rectangle. It should output the area and perimeter of
    10·1 answer
  • One problem with _______ is that often many copies of the same document are made. <br><br>HELPPP ​
    11·1 answer
  • 11 Select the correct answer. Which external element groups items in a design?
    9·1 answer
  • 1. Give one reason why data is represented in binary in a computer [1]
    10·1 answer
  • The _____ _____ form of database attack injects code into user login information with one or more statements that perform action
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!