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
Secondary sources<br> information gathered from primary sources.
sergeinik [125]

Answer:

what

Explanation:

8 0
3 years ago
Read 2 more answers
What are the pieces of information that describe the appearance of a cells content
Allushta [10]

Answer:

Information about the parts of a cell, its location and role will help describe the appearance of a cell's content.

Organelles are cell structures that include the nucleus, cytoplasm, cell membrane among others. One can view these using a light microscope.

1. Cell Membrane is a fluid mosaic. It is the outer boundary of the cell.

2.Cytoplasm is the fluid inside the cell. It is located between the nucleus and the cell membrane.

3.Nucleus is the control center of the cell and is located at the center.

4 0
2 years ago
What should I do when the computer doesn't display Korean?(They are all □□)
bogdanovich [222]

Answer:

I Think You Could Go To Settings And Change It

Explanation:

I Think This Helps

5 0
3 years ago
The proof that the Clique problem is NP-complete depends on a construction given in Theorem 34.11 (p. 1087), which reduces 3SAT
ki77a [65]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the step by step explanation to the question above.

5 0
3 years ago
Think of a simple software project that requires your design skills. Specify the requirements needed on each design process
andrew-mc [135]

Answer:In this guide, we'll go over the basics of your software development ... I know which option I'd choose. ... Will you need to integrate with other tools or APIs? ... With the requirements in place, it's time to start designing what this ... In its most basic form, you can think of the Waterfall method as following each ...

Explanation:

4 0
3 years ago
Other questions:
  • Many professional photographers take pictures of people. What skills would someone have to have to be successful in these types
    13·1 answer
  • In the windows firewall, any rules preceded by a __________ checkmark have not been enabled. black gray green red
    13·1 answer
  • According to the Big Five Factors model, all but _____ are categories.
    11·1 answer
  • How much space should be allotted to park your vehicle parallel to the curb?
    5·1 answer
  • Complete the sentence to identify disadvantages of top-down programming design. Choose all that apply. Top-down programming desi
    9·1 answer
  • Andre is teaching a class without the software development cycle while teaching the analyst phase which task should Andre mentio
    8·1 answer
  • Matthew is working to select an authentication method for his company that will support REST as well as many web-based and mobil
    12·1 answer
  • Someone please tell me please y my ps4 controller won’t charge:(
    12·2 answers
  • 2 4.1.2 Quiz: Information Systems and Business Planning
    11·1 answer
  • What is the most common type of storage device for transferring files from one computer to another?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!