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
I can't find my grandson someone help
Artemon [7]

Answer:

i'm right here

Explanation:

grandma

8 0
2 years ago
Read 2 more answers
16.50. Suppose we have a sequential (ordered) file of 100,000 records where each record is 240 bytes. Assume that B = 2,400 byte
Nat2105 [25]

Answer and Explanation:

Given that total number of records in a file = 100000

Each record consists of= 240 bytes

Given that B= 2400 bytes.

Then total blocks in file = 100000 records * 240 / 2400

= 10000 blocks.

Time that will take for exhaustive read

= s + r + b.btt

= 16 + 8.3 + (10000) * 0.8

= 8024.3 msec

Now as per given X be the number of records that are searched randomly and it takes more than exhaustive read time.

Hence, X (s + r + btt) > 8024.3

X (16+8.3+0.8) > 8024.3

X > 8024.3/25.1

So that, X > 319.69

Hence, atleast 320 random reads should be made to search the file

8 0
3 years ago
Create and execute a SELECT statement that would provide data for a vendor directory. Display should include vendor number, vend
Luba_88 [7]

Answer:

SELECT vendor_number, vendor_name, CONCAT ('street', ' ' , 'city', ' ' , 'state', ' ' , 'zip code') as adress

FROM vendor_directory

ORDER BY vendor_name ASC;

Explanation:

* Suppose <u>vendor_directory</u> is the name of the table from which you extract the data with the SELECT sentence.

8 0
3 years ago
What is a URL (Please explain)?
GalinKa [24]
Definition

URL a.k.a uniform resource locater, is simply the address of a World Wide Webpage.

Sentence example:

"Type a URL into a browser's address bar."
5 0
3 years ago
True or False? Any edition or version of Windows can join a domain.
Veseljchak [2.6K]

Answer: TRUE! 100%

If I was helpful i would to be rated brainliest please thank you!

Explanation:

8 0
2 years ago
Other questions:
  • After placing her insertion point after Grandma’s Kitchen, order the steps Danica needs to follow to insert and format the regis
    8·2 answers
  • List and explain the error in the code
    14·1 answer
  • Write a program that produces this output:
    10·1 answer
  • To combat piracy, many software publishers require users to type in a(n) ____ code, a sequence of numbers and letters in order t
    10·1 answer
  • Between Handshake protocol, change cipher suite, alert and appplication data protocols, the first one to use is:
    13·1 answer
  • Copy the following code and run it. You should break it into the following 3 functions
    6·1 answer
  • Escribe un ejemplo de:• Software de aplicación. • Software de diagnóstico. • Software de sistema. ayudenme plis, me toca entrega
    10·1 answer
  • Write a function in Java to implement the following logic:
    13·1 answer
  • Interstate highway numbers Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 of 95) go north/south, an
    8·1 answer
  • Many programmers think object-oriented programming is a superior approach to procedural programming. Others think it adds a leve
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!