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]
2 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]2 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
______ is data that is entered into a computer. ______ is the result produced by a computer.
Umnica [9.8K]
Input
Output
(Sorry for not being detailed)
5 0
2 years ago
Distinguish between a computer drive and computer driver​
rewona [7]

Answer:

The word Drive typically refers to a mechanical hard drive or solid-state hard drive used to store the OS, data and programs. A driver is software code that interfaces the various devices in the computer with the processing system.

Explanation:

..............................................................

6 0
2 years ago
What does the acronym OSHA stand for? A. Occupational Safety and Health Administration B. Occupational Safety and Human Activiti
poizon [28]
The answer is A. Occupational Safety and health Administration.
4 0
2 years ago
Read 2 more answers
What item is at the front of the list after these statements are executed?
Veseljchak [2.6K]

Answer:

A.Sam.

Explanation:

We are using Deque interface which is sub type of  Queue interface. Deque supports insertion and deletion from both ends front and end.So it can be used as a queue and stack also.

In this question we have inserted Jack at the front first.Then Rudy at the back then larry also at the tail.Now we have added sam at the front then nothing is added to the front.So the answer is Sam.

7 0
3 years ago
1 : What format would you apply to give an entry the appearance of 12-Mar-2014
Arturiano [62]

Answer:

1. Date 2. It will appear to the right of the selected column.

4 0
2 years ago
Other questions:
  • Lossless and lossy are the two (2) universally known categories of compression algorithms. Compare the two (2) categories of alg
    8·2 answers
  • What is the purpose of inserting SmartArt in a Microsoft Office program? (1 point)
    11·2 answers
  • How can you best protect yourself when using social media
    5·2 answers
  • Given two ArrayLists of sorted strings (alphabetically ascending), write down a method to merge these sorted strings’ ArrayLists
    10·1 answer
  • 6. Which of the following is malware? (1 point)
    15·2 answers
  • In most software packages, the function key F1 is used to run the _____program.
    10·1 answer
  • Which statement best describes the purpose of the Insert Function dialog box?
    13·1 answer
  • A digital system has been developed to measure temperatures in the range -10˚C to 100˚C. If the accuracy of the system is such t
    11·1 answer
  • Which one my guys I need help
    7·1 answer
  • A(n) ___________ allows people at two or more locations to interact via two-way video and audio transmissions simultaneously as
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!