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
Crazy boy [7]
3 years ago
6

Write a Java program named Problem 3 that prompts the user to enter two integers, a start value and end value ( you may assume t

hat the start value is less than the end value). As output, the program is to display the odd values from the start value to the end value. For example, if the user enters 2 and 14, the output would be 3, 5, 7, 9, 11, 13 and if the user enters 14 and 3, the output would be 3, 5, 7, 9, 11, 13.
Computers and Technology
1 answer:
Mashcka [7]3 years ago
5 0

Answer:

hope this helps

Explanation:

import java.util.Scanner;

public class Problem3 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter start value: ");

       int start = in.nextInt();

       System.out.print("Enter end value: ");

       int end = in.nextInt();

       if (start > end) {

           int temp = start;

           start = end;

           end = temp;

       }

       for (int i = start; i <= end; i++) {

           if (i % 2 == 1) {

               System.out.print(i);

               if (i == end || i + 1 == end) {

                   System.out.println();

               } else {

                   System.out.print(", ");

               }

           }

       }

   }

}

You might be interested in
Select the correct answer.
snow_tiger [21]

Answer: I think it's D.

Explanation: I'm sorry if I chose the wrong answer, I'm not too good with stuff like this.

3 0
2 years ago
Who plays oblox .............................
Kazeer [188]

Answer:

Me

Explanation:

3 0
3 years ago
Read 2 more answers
Introduction of waste management​
Molodets [167]

Answer:

Waste management (or waste disposal) includes the activities and actions required to manage waste from its inception to its final disposal. ... Waste management deals with all types of waste, including industrial, biological and household. In some cases, waste can pose a threat to human health.

7 0
3 years ago
Name any four areas where computers are used​
ivann1987 [24]

Answer:

Computers are used for Business

Computers are used for Education

Computers are used for Science

Computers are used for Communication.

7 0
3 years ago
There was a robbery from the ATM at the bank where you work. Some unauthorized withdrawals were made, and you need to help your
larisa [96]

Following are the SQL query commands to the given question:

Query:

select customer_name /*using inner select query  */

from

(

/* select column names*/

 SELECT  customer_name,

       transaction_time,

       next_transaction_time,

       TIME_TO_SEC(TIMEDIFF(next_transaction_time, transaction_time)) as difference

FROM    (   SELECT  customer_name,

                   transaction_time,

                   (   SELECT  MIN(transaction_time)  

                       FROM    customer_transactions T2

                       WHERE   T2.customer_name = T1.customer_name

                       AND     T2.transaction_time > T1.transaction_time

                   ) AS next_transaction_time

           FROM    customer_transactions T1

       ) AS T

) X

/*Using group by clause with min and max method*/

GROUP BY customer_name HAVING MIN(difference) = 10 and MAX(difference) = 10

Explanation of query:

  • In this question, Subqueries, group by clause, with the max and min method is used which purpose can be defined as follows:
  • It is utilized for returning information which is used to better limit the data to be found in the primary query.
  • It returns no or more rows through one or more tables or views of the database.
  • It organizes rows into groups depending on its values for one or more columns.
  • Grouping is usually utilized to use some kind of aggregate function for every group.
  • The function MIN() returns the lowest value of the column chosen.
  • The function MAX() returns the highest number in the column chosen.

Learn more:

brainly.com/question/1765746

7 0
3 years ago
Other questions:
  • Type dig www.example A in order to get the IP address of www.example. What’s the TTL of the A record returned in the response? W
    9·1 answer
  • Which of the following is a strength of fiscal policy?
    15·1 answer
  • What is the khan academy game where it is a block having to jump over lava and is an endless runner
    9·1 answer
  • Which is the correct process for inserting a blank worksheet?
    11·2 answers
  • Please help!
    15·1 answer
  • PLZZZZ HELP!!!
    12·2 answers
  • If an electric circuit has 30ohms and 10amps. How many volts the battery voltmeter should read?
    10·1 answer
  • A person is sledding down a hill at a speed of 9 m/s. The hill gets steeper and his speed increases to 18 m/s in 3 sec. What was
    6·1 answer
  • South Africa is the main supplier of which minerals in the world​
    10·2 answers
  • Is Aerospace Engineering a more enjoyable major than Computer Engineering?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!