Answer:
import java.util.Scanner;
public class num4 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int sumOdds =0;
int sumEvens =0;
int num;
do{
System.out.println("Enter positive integers");
num = in.nextInt();
if(num%2==0){
sumEvens+=num;
}
else if (num%2!=0){
sumOdds+=num;
}
}while (num>0);
System.out.println("The sum of evens: "+sumEvens);
System.out.println("The sum of odds: "+sumOdds);
}
}
Explanation:
- Import Scanner class to prompt and receive user input
- Declare the following variables and initialize them int sumOdds =0, int sumEvens =0, int num;
- Create a do....while loop That continously prompts user to enter a positive number. The loop should terminate when a negative number is enters (n<=0)
- Within the while loop use an if condition with the modulo (%) operator to determine even and odd numbers and add to the respective variables
- Outside of the while loop Print sum of odds and sum of evens
Answer: She sets an access password while saving the file. hope this helps!!!!
Explanation:
Set them up from least to greatest or create a number graph with all the data.
The correct explanation of the first line in poems is; Choice B; The first lines determine all of the poet's subsequent choices.
<h3>Meaning of poem</h3>
By literature definition, a poem is a piece of writing in which the words are chosen for their beauty and sound and are carefully arranged, often in short lines which rhyme.
To ensure that these short lines in poems rhyme, the first line serves as a template and consequently, determines all of the poet's subsequent choices.
Read more on poems and first line;
brainly.com/question/4343450
Answer:
in my opinion I choose the rule of simplification