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
Ray Of Light [21]
3 years ago
12

Create a basic program that accomplishes the following requirements: Allows the user to input 2 number , a starting number x and

ending number y Implements a while loop that counts from x (start) to y(end). Inside the loop , print to the screen rather the current number is even or odd If the number is even , multiply by the number by 3 and print the results to the screen. If the number is odd , add 10 and print the results to the screen. Use at least 1 increment or decrement operator.
Computers and Technology
1 answer:
katrin [286]3 years ago
6 0

Answer:

Explanation:

The following program is written in Java. It asks the user for the two inputs and then uses those inputs in a for loop. The loop goes through each number checking to see if it is even or odd. If it is even it prints out Even: and the number after multiplying it by 3. If it is odd it prints out Odd: and the number after adding 10 to it. The output can be seen in the attached picture below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

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

       int num1 = in.nextInt();

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

       int num2 = in.nextInt();

       for (int x = num1; x <= num2; x++) {

           if ((x % 2) == 0) {

               System.out.println("Even: " + (x*3));

           } else {

               System.out.println("Odd: " + (x+10));

           }

       }

   }  

}

You might be interested in
Este tipo de software sirve para controlar e interactuar con el sistema operativo, proporcionando control sobre el hardware y da
attashe74 [19]

Answer: c

Explanation:

4 0
3 years ago
Which of the following websites is least biased
labwork [276]
I think it's D because it's made out of facts. The other ones are more likely to include bias.
8 0
4 years ago
Graphic images can be stored in a variety of formats including ____.
Marrrta [24]
Graphic images can be stored in a variety of formats including JPEG and GIF. Hope this helped!
5 0
3 years ago
Document templates are available online.<br> True<br> False
k0ka [10]
True anything is available online.
6 0
3 years ago
Read 2 more answers
On which tab are import and export commands located in Access? A. Home B. Database Tools C. External Data D. Create
Ann [662]

Answer:

C. External Data

Explanation:

On the External Data tab, you can find import and export commands located in Access.

7 0
3 years ago
Other questions:
  • HELP PLEASE
    7·2 answers
  • I plugged my phone up into a charger, the charger sparked and i unplugged my phone and now it wont charge at all, does anyone kn
    13·1 answer
  • Temporary storage location for cutting and pasting
    9·1 answer
  • What is data protection
    13·1 answer
  • Which of the following Statements accurately describes the legality of telemarketing
    12·1 answer
  • You can use this type of program to create a new raster image
    9·1 answer
  • Which option is the default when creating appointments and meetings in a user’s own calendar as it relates to Free/Busy informat
    8·1 answer
  • Find each of the following products using distributive property a) 735 × 16​
    12·1 answer
  • Why do we use the internet so much?​
    6·1 answer
  • What is pollution?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!