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
lyudmila [28]
2 years ago
15

Output values below an amount Write a program that first gets a list of integers from input. The input begins with an integer in

dicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers. java
Computers and Technology
1 answer:
Katarina [22]2 years ago
6 0

The program that first gets a list of integers from input, gets the last value from the input, which indicates a threshold, and outputs all integers less than or equal to that last threshold value is:

import java.util.Scanner;

public class LabProgram {

 /* Define your methods here */

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in);

int[] userValues = new int[20];

int upperThreshold;

int numVals;

numVals = scnr.nextInt();

GetUserValues(userValues, numVals, scnr);

upperThreshold = scnr.nextInt();

OutputIntsLessThanOrEqualToThreshold(userValues, numVals, upperThreshold);

}

}

Read more about java programming here:

brainly.com/question/26952414

#SPJ1

You might be interested in
Which of the following is NOT considered a step in the problem solving process. A Try B Discover C Prepare D Define
pashok25 [27]

Answer:

c

Explanation:

4 0
3 years ago
Python - Please help!
Margaret [11]

Answer:

i= 1

for i in range(1,n):

     if i * i < n:

           print(2* i + 1)

     i += 1

else:

     print('Hakuna Matata')

Explanation:

First, there's a need to rewrite the code segment in your question (because of indentation)

<em>i= 1</em>

<em>while i*i < n:</em>

<em>      print(2* i + 1)</em>

<em>      i += 1</em>

<em>else:</em>

<em>      print('Hakuna Matata')</em>

<em />

The explanation of the equivalent of the above while loop is as follows

This line initializes i to 1

i= 1

This line iterates from 1 to n-1

for i in range(1,n):

This line checks if i * i is less than n

     if i * i < n:

The following line is executed if the above condition is satisfied; otherwise, nothing is done

           print(2* i + 1)

The value of i is incremented by 1 using this line

     i += 1

The following is executed at the end of the iteration

else:

     print('Hakuna Matata')

<em>Note: Assume any value of n, both programs display the same output</em>

6 0
3 years ago
Presentation software allows you to display information in the form of a slide show.
sammy [17]
Access is not presentation software. i use all 4
6 0
4 years ago
When sensing nonverbal communication, the listener candetermine happiness, fear, and sadness primarily from______body movementge
lilavasa [31]

Answer: Eyes and face

Explanation: The non-verbal communication defines the communication through the facial expression gesture, posture etc. This type of communication happens where there is no requirement or permission of being verbal or just to judge a person without having communication with them .The expression obtained from face are enough to determine the emotion of a person whether he/she is happy, sad or scared.

7 0
4 years ago
Two strings are anagrams if they are written using the same exact letters. Write a method to check if given two strings are anag
Andre45 [30]

Answer:

Check the explanation

Explanation:

import java.util.Scanner;

public class Anagrams {

   public static int count(String s, char ch) {

       int c = 0;

       for (int i = 0; i < s.length(); ++i) {

           if (s.charAt(i) == ch) {

               c++;

           }

       }

       return c;

   }

   public static boolean isAnagram(String s1, String s2) {

       char ch;

       s1 = s1.toLowerCase();

       s2 = s2.toLowerCase();

       for (int i = 0; i < s1.length(); ++i) {

           ch = s1.charAt(i);

           if (ch != ' ' && count(s1, ch) != count(s2, ch)) {

               return false;

           }

       }

       for (int i = 0; i < s2.length(); ++i) {

           ch = s2.charAt(i);

           if (ch != ' ' && count(s1, ch) != count(s2, ch)){

               return false;

           }

       }

       return true;

   }

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter the first string: ");

       String s1 = in.nextLine();

       System.out.print("Enter the second string: ");

       String s2 = in.nextLine();

       if (isAnagram(s1, s2)) {

           System.out.println(s1 + " and " + s2 + " are anagrams");

       } else {

           System.out.println(s1 + " and " + s2 + " are NOT anagrams");

       }

   }

}

Kindly check the output image below.

4 0
4 years ago
Read 2 more answers
Other questions:
  • What is the name of a computer or application program that intercepts user requests from the internal secure network and then pr
    11·1 answer
  • A.<br> Post-It note<br> b.<br> notebook<br> c.<br> tutor<br> d.<br> spell check
    14·1 answer
  • How do you validate the type of text that a user enters?
    7·1 answer
  • Online banking tools allow you to pay bills from your computer. <br> a. True<br> b. False
    5·2 answers
  • What is GND and what color wire do we connect to GND? (this is like for circuits and stuff btw)
    7·1 answer
  • Image
    12·2 answers
  • Which of the following is one aspect of gaming that goes relatively unnoticed but
    10·1 answer
  • The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function so that it is written as
    10·1 answer
  • What is a video input device? .​
    12·1 answer
  • You have been asked to configure a client-side virtualization solution with three guest oss. Each one needs internet access. How
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!