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
whats that system tool the rearranges files and unused space on the hard drive so programs can run faster
Zolol [24]
The Disk Fragmenter.
5 0
3 years ago
Read 2 more answers
Programming Project: N-Queens Prerequisites: Chapter 5 For this project you will create a class that solves a variation of the 8
Alex
Socractic Would Definitely Help With An Answer Like This
5 0
3 years ago
A _____________ is a situation in which a hacker attempts to disrupt the network by sending messages to the network that prevent
LUCKY_DIMON [66]
I think its a virus or a trojan horse
8 0
3 years ago
Subject: TLE (Technology and Livelihood Education)
Leviafan [203]

Answer

First term (t₁) = a = 3, Common difference (d) = 8 - 3 = 5 and last term (tₙ) = 78

78 = 3 + (n - 1)5

⇒ 78 = 3 + 5n - 5

⇒ 78 = -2 +5n

⇒ 78 + 2 = 5n

⇒ 80 = 5n

⇒ n = 16

Therefore, 78 is 16th term of A.P: 3, 8, 13, 18...

5 0
3 years ago
A user has reported that the company notebook is performing some random mouse actions requiring the user to make a lot of typing
Anna35 [415]

Answer:

By using the function key to disable the mouse pad.

Explanation:

If the company notebook is performing mouse actions that are random causing the user to make a lot of typing corrections.The technician can solve this issue for the user by using the function key to disable the mouse pad.It can be done by pressing the fn(function key) + F7.This function key is only present on the notebook not on the PC keyboards.

8 0
3 years ago
Other questions:
  • Assume that a program uses the named constant PI to represent the value 3.14. The program uses the named constant in several sta
    9·1 answer
  • Why is it important to send a cover letter with a resume?
    12·2 answers
  • The ________ of the operating system enables the user to communicate with the computer system. Select one:
    9·1 answer
  • A ____ typically rests on the desk or other flat surface close to the user’s computer, and it is moved across the surface with
    13·1 answer
  • C++
    10·2 answers
  • __________ is a very simple form of lossless data compression in which runs of data (that is, sequences in which the same data v
    6·1 answer
  • What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
    15·1 answer
  • Code the function definition for aNonclassFunction, picking up co. aNonclassFunction has no return value.
    8·1 answer
  • What is the primary difference among a domain model, an analysis model, and a design model for the same project?
    15·1 answer
  • Differenciate between foreign key and primary key in database.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!