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
Veronika [31]
2 years ago
7

Write a program with a loop that lets the user enter a series of positive integers. The user should enter −1 to signal the end o

f the series. The program should count all the numbers entered, compute the running total of the numbers and displays their count, total and average. Display average to decimal places.
Computers and Technology
1 answer:
Fiesta28 [93]2 years ago
5 0

Answer:

import java.util.Scanner;

public class num2 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int count =0;

       int total = 0;

       System.out.println("Enter the numbers");

       int num = in.nextInt();

       while(num!=-1){

           total = total+num;

           count++;

           System.out.println("Enter the next number");

           num = in.nextInt();

       }

//Compute the average

       double average = (double) total/count;

//Outputs

       System.out.println("Total count of numbers entered "+(count));

       System.out.println("Sum of the numbers "+total);

       System.out.printf("Average is %.2f ",average);

   }

}

Explanation:

  • Using java programming language
  • Import scanner class to receive user input
  • declare variables count and total and initialize to zero
  • Prompt user to enter numbers
  • Use a while statement with the condition while(num!=-1)
  • Within the while body keep prompting user to enter a number, increase count and update total
  • when -1 is entered the loop breaks and average is calculated
  • Use printf() method to print average to 2 decimal places.
You might be interested in
Which of the following are benefits of designing a scalable system? choose 3 options.
ollegr [7]
I asked my brother since he’s kinda of tech geek and he said

The 1st, 3rd, and 5th answers are correct

Hope this helps and I hope my brother is not wrong.
7 0
3 years ago
Selah infects the ads on a website that users from her target company frequently visit with malware as part of her penetration t
ValentinkaMS [17]

Selah infects the ads on a website with a technique called the Watering hole attacks.

<h3> What is Watering hole attacks?</h3>

The  Watering hole attacks is known to be a form of attack that depends on compromising or infecting a website that has or that targeted users who are known to often frequently visit.

So, Selah infects the ads on a website with a technique called the Watering hole attacks.

Learn more about malware from

brainly.com/question/399317

#SPJ1

8 0
1 year ago
Your organization recently deployed a Windows domain controller with Active Directory. All the domain OU users need to run the s
liberstina [14]

<u>Normally windows end user can login 3 ways as follow:</u>

1. End user can Login as local account where user has not connected or even connected to local Area network LAN.

2. Next user can login into cloud accounts nothing but hot mail  accounts

3. Login to windows domain controller where end user should connect to LAN.

Purpose of installation of Windows domain controller with Active Directory is to keep trace and keep log history activities.

Due to windows domain controller with Active Directory end user desktop or laptop has control on software access also.

Every time when end user login on windows domain controller a small modified is executed whenever is required. It is not going effort the workstation performances.

Note: - Domain severs should be POWER on first.

5 0
3 years ago
Identify any eight new programming languages and classify them based on their functionality.
shepuryov [24]

Answer:

Some of the new programming languages are R, Python, Haskell, Swift, C++, Java, Javascript and PHP.

However, you should know that in general sense there are three types of programming languages.

R is a pure object-oriented programming language being used for scientific purposes, and now it is being used extensively for machine learning as well.

Python is also a pure object-oriented programming language, and it is being used for mainly machine learning. However, you need to keep in mind that it supports the functional programming paradigm as well.

Haskell is a functional programming language and is the best in the functional paradigm as well. You can compare it with LISP, FORTRAN and PASCAL or COBOL, and you will find that Haskell is the best.

Swift is a pure object-oriented programming language, And by pure it means it never cheats anybody like if it says a variable is an int, it will be an int and not like C# here a string data type can be an integer data type. And this is not the correct thing. However, if you study in deep, you will find it is a necessary evil.

C++ and Java are imperative programming languages.

The Javascript and PHP are the scripting languages that support the object-oriented programming concepts but not fully, and they too fall under the imperative programming language list.

Explanation:

The answer is self explanatory.

4 0
3 years ago
Read 2 more answers
A network technician is asked to redesign an Ethernet network before some new monitoring software is added to each workstation o
mina [271]

Answer: network administrator

Explanation:

8 0
3 years ago
Other questions:
  • Which magazine can help the public to determine the best technology to buy?
    14·1 answer
  • Compare the applications below:
    10·2 answers
  • Malwar is the short form for malicious software and used to refer​
    14·1 answer
  • Mary can view the thumbnails of her presentation slides when she’s creating the slides which element of the programs interface i
    8·1 answer
  • Using the drop-down menu, complete these sentences to describe algorithms. Algorithms are instructions to solve a problem. Algor
    12·2 answers
  • Does anyone know a good reason WHY to change your username.
    5·1 answer
  • What will the following code display? int numbers[4] = { 99, 87 }; cout &lt;&lt; numbers[3] &lt;&lt; endl; a. 87 b.0 d. 34. What
    12·1 answer
  • What is the nearest ten cents of 453.56
    5·1 answer
  • To make changes to how UAC operates, you must be logged in as administrator true or false
    6·1 answer
  • What is computer fundamental ?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!