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
kompoz [17]
3 years ago
10

Write an application that inputs three numbers (integer) from a user. (10 pts) UPLOAD Numbers.java a. display user inputs b. det

ermine and display the number of negative inputs c. determine and display the number of positive inputs d. determine and display the number of zero inputs e. determine and display the number of even inputs f. determine and display the number of odd inputs
Computers and Technology
1 answer:
SCORPION-xisa [38]3 years ago
7 0

Answer:

The program to this question as follows:

Program:

import java.util.*; //import package for user input

public class Number //defining class Number

{

public static void main(String[] ak)throws Exception //defining main method

{

int a1,b1,c1; //defining integer variable

int p_Count=0,n_Count=0,n_Zero=0,even_Count=0,odd_Count=0;

Scanner obx=new Scanner(System.in); //creating Scanner class object

System.out.println("Input all three numbers: "); //print message

//input from user

a1=obx.nextInt(); //input value

b1=obx.nextInt(); //input value

c1=obx.nextInt(); //input value

//check condition for a1 variable value

if(a1>0) //positive number

p_Count++;

else if(a1==0) //value equal to 0

n_Zero++;

else //value not equal to 0

n_Count++;

if(a1%2==0)//check even number

even_Count++;

else //for odd number

odd_Count++;

//check condition for b1 variable value

if(b1>0) //positive number

p_Count++;

else if(b1==0) //value equal to 0

n_Zero++;

else //value not equal to 0

n_Count++;

if(b1%2==0) //check even number

even_Count++;

else //for odd number

odd_Count++;

//check condition for c1 variable value

if(c1>0) //positive number

p_Count++;

else if(c1==0) //value equal to 0

n_Zero++;

else //value not equal to 0

n_Count++;

if(c1%2==0) //check even number

even_Count++;

else //for odd number

odd_Count++;

//print values.

System.out.println("positive number: "+p_Count);//message

System.out.println("negative number: "+n_Count); //message

System.out.println("zero number: "+n_Zero); //message

System.out.println("even number: "+even_Count); //message

System.out.println("odd number: "+odd_Count); //message

}

}

Output:

Input all three numbers:

11

22

33

positive number: 3

negative number: 0

zero number: 0

even number: 1

odd number: 2

Explanation:

In the above java program code a class is defined in this class three integer variable "a1,b1, and c1" is defined which is used to take input value from the user end, and other integer variable "p_Count=0, n_Count=0, n_Zero=0, even_Count=0, and odd_Count=0" is defined that calculates 'positive, negative, zero, even, and odd' number.

  • In the next step, the conditional statement is used, in if block a1 variable, b1 variable, c1 variable calculates it checks value is greater then 0, it will increment the value of positive number value by 1.
  • else if it will value is equal to 0. if this condition is true it will negative number value by 1
  • else it will increment zero number values by 1.
  • In this code, another if block is used, that checks even number condition if the value matches it will increment the value of even number by 1, and at the last print, method is used that print all variable values.
You might be interested in
How do you delete a slide from your presentation after selecting it
Sergeeva-Olga [200]
Use your right clicker and it should pop up as delete slide

6 0
4 years ago
the process of adjusting an IDPS to maximize its efficiency in detecting true positives, while minimizing both false positives a
Dafna1 [17]

Answer:

Tuning. See explanation below.

Explanation:

Tuning

By definition the tuning is: "the process of adjusting an IDPS to maximize its efficiency in detecting true positives, while minimizing both false positives and false negatives."

And this process is the improvement of system performance in computer science. Usually is related to optimization of a process, when we us tunning, we can follow these steps:

a) Identify which numeric values are acceptable and improve the parameters

b) Take a measure for the system originally and without the tunning in order to have an initial comparative measure

c) Understand that each process have a critical path, we need to identify it.

d) Modify parts who not improve the efficiency of the algorithm

e) Check the performace when we apply modifications

5 0
4 years ago
If you paste a word document text into an excel spreadsheet, the paste optio allow you to keep source formatting or
castortr0y [4]
I think the answer is c
6 0
3 years ago
_______ computing refers to applications and services that run on a distributed network using virtualized resources.
denis23 [38]
D.cloud is my answer
7 0
4 years ago
We piped the results of the Get-Process cmdlet to the Sort-Object cmdlet to sort them in descending order. Which property was us
Basile [38]
The answer is yes hope this helps did before
5 0
3 years ago
Other questions:
  • This provides an easy method for workers to use their computers.
    5·1 answer
  • When a computer restarts without a hardware power-down-power-up cycle, it is doing a _______________?
    9·1 answer
  • What should you do to protect your copyright
    7·1 answer
  • Which of the following best describes Roblox?
    12·2 answers
  • Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline. Ex: If letterToQuit = '
    12·1 answer
  • If you’re trying to reduce your debt, which of these expenses should you consider cutting out or cutting back on first?
    5·2 answers
  • List three ways security could be improved for taking the prepared deposit monies to the bank?​
    11·1 answer
  • How can the use of new technology in industry benefit the us government
    8·2 answers
  • Describe how computer are used in ticket counter?​
    10·1 answer
  • Describe the layout of an article on Wikipedia​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!