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
Viktor [21]
3 years ago
15

Write a program that prompts the user to enter a number then counts the number of odd numbers and even numbers the user enter. T

he program should exit if the user enter a zero or a number less than zero. For example, if the user enters 4, 7, 9, 8 21, 22, -1; upon entering -1 the program displays/output "3 even numbers and 3 odd numbers" were entered, then the program terminate
Computers and Technology
1 answer:
neonofarm [45]3 years ago
7 0

Answer:

The program written in Java is given in the explanation section

Explanation:

<em>import java.util.Scanner;</em>

<em>public class num3 {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("This program counts evens and odds");</em>

<em>        System.out.println("To exit enter ZERO  or a NEGATIVE number");</em>

<em>        int num = in.nextInt();</em>

<em>        int numEvens=0;</em>

<em>        int numOdds = 0;</em>

<em>         while(num>=1){</em>

<em>             if(num%2==0){</em>

<em>              numEvens++;</em>

<em>             }</em>

<em>             else{</em>

<em>              numOdds++;</em>

<em>                }</em>

<em>             System.out.println("Enter the next number");</em>

<em>             num = in.nextInt();</em>

<em>            }</em>

<em>            System.out.println(numEvens+" even numbers and "+numOdds+" odd numbers");</em>

<em>    }</em>

<em>}</em>

You might be interested in
What is an antispamming approach where the receiving computer launches a return attack against the spammer, sending email messag
Burka [1]

Answer:

Teergrubing.

Explanation:

Teergrubing is an antis-pamming approach where the receiving computer launches a return attack against the spammer, sending email messages back to the computer that originated the suspected spam.

It is a good antis-pamming approach because it slows response to the Simple Mail Transfer Protocol (SMTP) commands, thus tying up resources.

8 0
3 years ago
Read 2 more answers
Suggest names for a coding club
bulgar [2K]

Answer:

  • <u>Abstract Connoisseurs.</u>
  • <u>Hypertext Assassins.</u>
  • <u>Callback Cats.</u>
  • <u>Boolean Autocrats.</u>
  • <u>Runtime Terror.</u>

Explanation:

<em><u>Hope it's help you !!</u></em>

3 0
2 years ago
Defeating authentication follows the method–opportunity–motive paradigm.
sashaice [31]

Answer:

Method:- This is related to hackers technique and way of accessing to copy other data. It also includes the skill, knowledge, tools and other things with which to be able to pull off the attack.

Opportunity:- this is related to how a user gives way to access to the hackers. It includes the time, the chance, and access to accomplish the attack.

Motive:- This may relate to the hacker to destroy the reputation of another or for money. It is reason to want to perform this attack against this system

3 0
3 years ago
The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
kenny6666 [7]
Regedit is the Answer
3 0
3 years ago
What is 1/10 of 2.0 in decimal form​
son4ous [18]

Answer to this is .2

5 0
3 years ago
Other questions:
  • GenXTech is a growing company that develops gaming applications for military simulations and commercial clients. As part of its
    9·1 answer
  • How can I make my Wi-Fi signal fast? I am going through my exam but my Wi-Fi is not supporting plz help.
    12·1 answer
  • A student is curious about how a Web site appears on his computer screen. On a piece of paper,
    9·1 answer
  • How many people employed in the United States work in a job related to digital media?
    12·1 answer
  • Can anyone can tell me and explain me the answer of it please .<br>thanks
    9·1 answer
  • Calculate the cash available to retire debt for each of the six months. There is cash available to retire debt if there is a cas
    8·1 answer
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    13·1 answer
  • Typically, a DVD has how many times more capacity than a CD?
    12·1 answer
  • 5. Write the name of the tab, command group, and icon you need to use to access the
    11·2 answers
  • What is the importance of test documentation?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!