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
harkovskaia [24]
2 years ago
12

Design and implement a program that reads a series of 10 integers from the user and prints their average. Read each input value

as a string, and then attempt to convert it to an integer using the Integer.parseInt method. If this process throws a NumberFormatException (meaning that the input is not a valid number), print an appropriate error message and prompt for the number again. Continue reading values until 10 invalid integers have been entered.
Computers and Technology
1 answer:
irina [24]2 years ago
3 0

Answer:

Explanation:

The following program was written in Java. It creates a loop that asks the user for numbers. If it can convert it to an integer it accepts it and adds it to the sum variable otherwise it ouputs that it is not a valid number. Once all 10 integers are added it prints the Average of the values entered.

import java.util.ArrayList;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int count = 0;

       int sum = 0;

       while (count != 10) {

           System.out.println("Enter a number: ");

           String answer = in.nextLine();

           try {

               int intAnswer = Integer.parseInt(answer);

               sum += intAnswer;

               count += 1;

           } catch (NumberFormatException e) {

               System.out.println("Not a valid number.");

           }

       }

       int average = sum / count;

       System.out.println("Average: " + average);

   }

}

You might be interested in
Do you watch markiplier?
ki77a [65]

Answer: Yes

Explanation: He is cool

5 0
3 years ago
Read 2 more answers
How do I type fast?<br><br> Give me an actual answer...
Ugo [173]
Practice!
And a good keyboard I recommend mechanical key boards
But the best way to improving your WPM is definitely practice one way you can practice is playing typeracer it’s pretty fun way

Hope this helps!
Brainliest is much appreciated!
7 0
2 years ago
Read 2 more answers
Hi, please help me, solution.​
loris [4]

Answer:

error: incompatible types

Explanation:

Given

The attached code

Required

The output

Variable "a" is declared as float

While p is declared as a pointer to an integer variable

An error of incompatible types will be returned on line 3, <em>int *p = a;</em>

Because the variables are not the same.

To assign a to p*, we have to use type casting.

Hence, (b) is correct

5 0
3 years ago
The users in your organization bring their own mobile devices to the office and want to be able to access the network with them.
Afina-wow [57]

Answer:

The Windows feature that can be used to protect a network from malware threats that might be on the network user's mobile devices is;

Device Health Attestation (DHA)

Explanation:

Device Health Attestation (DHA) is a feature introduced in version 1507 of widows 10 that enables increased security of the network of enterprises to have mainly hardware which are attested and monitored using cloud based service health check or DHA service on Windows Server 2016.

Device Health Attestation carries out assessments on devices based on Windows 10 devices and Windows 10 mobile devices that work with TPM 1.2 or 2.0 and devices which are within the premises

Items checked include boot configuration and attributes such as Secure Boot, ELAM, and BitLocker

Corrective action are triggered by Mobile Device Management (MDM) based on report data from the DHA.

4 0
2 years ago
Pls help me computer science discoveries
lara31 [8.8K]

Answer:

jdinwoahdjsioadjsakodsiaohdeioajfnsohfujkdshksyfneowjdfikdjiadjsadhnsuidghaiudbnha

Explanation:

3 0
2 years ago
Other questions:
  • What does the Autosum feature on excel do?
    15·1 answer
  • You have been hired to set up a network for XYZ Enterprises. What factors will you consider to determine the type of network nee
    7·2 answers
  • If you wish to include a header or footer on all pages in a publication, you will need to insert this by navigating to the _____
    11·2 answers
  • Sally needs to copy data from the first worksheet to the fifth worksheet in her workbook. Which combination of keys will she use
    6·2 answers
  • (15 POINTS) When an error is made in HTML code, the browser does what?
    11·1 answer
  • A class is a _____, which encapsulates _____ and _____. (Points : 2) programming language construct; attributes; behavior
    7·1 answer
  • Which of the following is a valid HTML reference to a CSS file?
    13·1 answer
  • Que significa el término Informática?
    6·1 answer
  • State and explain three importance of internet education​
    7·2 answers
  • Each high-level language has its own __________, or rules of the language. group of answer choices
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!