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
Urgent. I will mark you brainliest. explain why cyber warfare is a real threat.​
stellarik [79]

Answer: Cyber warfare is a real threat since being able to hack another computer especially a countries computer with lots of info in their weaknesses can lead to their downfall. Since they can even possibly if their skilled enough hack their entire data base system and leak it to the public and that wouldn't be good for them not in a single possible way. That's the reason it's dangerous not only that but also because they can access their servers; which can let them access anything online from the whole country including banking information military info which can let them know which area there gonna go to next equipment there gonna bring and where they're gonna launch missiles, bombs, even nukes if they decide to launch one. And being able to hijack the computer that launches the nukes can make the hacker launch the nuke to a different place or launch the nuke on the country trying to launch the nuke.

Explanation:

3 0
2 years ago
Read 2 more answers
In 1940, the FCC reserved a set of frequencies in the lower range of the FM radio spectrum for _____ purposes as part of its reg
Monica [59]

Answer:

education purposes

Explanation:

Education institutes make some programs like School of the Air and College of the Air, forums, and discussion tables, in 1940 the FCC reserved a range of the FM radio spectrum for education purposes.

Although FM was unpopular when the FCC moved the FM bandwidth to a higher set of frequencies, and people and consumer stations had to buy new equipment.

5 0
3 years ago
Aika has several labeled folders for different parts of his research. What is the MOST likely reason he does this? He wants to m
kobusy [5.1K]

Answer:

<u>He wants to easily and quickly find specific bits of research that cover certain topics.</u>

<u>Explanation:</u>

Remember, a research work typically has these 6 (six) components:

  • The Abstract.
  • Introduction
  • Methodology
  • Results
  • Discussion
  • References.

Thus, Aika's decision to label several folders for different parts of his research would make it easier and quicker for him to find specific bits of research that cover certain topics, instead of spending time looking for topics.

4 0
3 years ago
When is an original work considered Public Domain? A. When posted via social media. B. When is it posted on the internet C. When
I am Lyosha [343]
<span>Best Answer is (D)
</span>

Any<span> materials not protected by copyright, patent laws or trademark are referred to as copyright. Generally, the public owns these works, and anyone is allowed to use public domain works without obtaining permission. There are various common ways that these works may end up arriving in the public domain. One of those ways includes the expiration of copyright. The copyright owner may also fail to follow renewal rules that govern copyright. </span>The copyright owner may as well decide to place his or her works deliberately in the public <span>domain.</span>

3 0
3 years ago
PL Technologies suffered considerable data loss when its database was infected by a virus. George, an operations personnel, atte
Luba_88 [7]

Answer:

Recovery is the correct answer to the given question.

Explanation:

Recovery is used when the data is lost from the database in any issue Database Recovery is giving the data to returning in its consistent state of the database.

When George sees that the  PL Technologies is suffered from considerable data loss due to it is infected by a virus then George retrieving the information and the data by using the recovery process  

6 0
3 years ago
Other questions:
  • All ofthe following are correct EXCEPT one option when it comes towriting disappointing news letters. Identify theexception.
    6·1 answer
  • This process can be applied to help workers choose the best telecommunications technology to do a specific task.
    6·2 answers
  • Write a method reverse( ) for OurLinkedList class. The method should return a new OurLinkedList object that is the reverse of th
    8·1 answer
  • This needs to be written in Java.
    11·1 answer
  • List three features of the third generation of computers
    13·1 answer
  • What does input allow a computer to do
    14·1 answer
  • Please help I will mark brainliest
    5·1 answer
  • Question 4
    5·1 answer
  • How does links helped a student like you in navigating the different available websites?
    5·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!