Asked Oct 12, 2019

Translate the following pseudocode for finding the minimum value from a set of inputs into a Java program.
Set a Boolean variable “first” to true.
While another value has been read successfully
If first is true
Set the minimum to the value just read
Set first to false
Else if the value is less than the minimum
Set the minimum to the value
Print the minimum


Expert Answer

Java program to find the minimum value

import java.util.Scanner;


public class Program


     Public static void main(String args[])


          Scanner input = new Scanner(;

          boolean first = true;

          double minimum = Double.MAX_VALUE;



              double newDouble = input.nextDouble();



                   minimum = newDouble;



Image Transcriptionclose

import java.util.Scanner; public class Program Public static void main(String args[]) Scanner input = new Scanner( boolean first= true; double minimum = Double.MAX_VALUE; while (input.hasnextDouble () ) input.nextDouble ( ) ; double newDouble if (first) minimum = newDouble; false; first } else if (newDouble < minimum) minimum = neWDouble; } System.out.println("The minimum value is", minimum); input.close() } } }


Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in


Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: Programming Question: Write a program in MIPS assembly language that asks the users to enter a value...

A:  Code which is written in MIPS assembly language is shown below-


Q: What is it when they say 4g or 5g phone network

A: The usage of 4G or 5G defines that the mobile phone includes 4G or 5G network for the communication....


Q: The question is asking for me to "Design a modular program that asks how many tickets for each class...

A: AS per Question,Class A Seat Cost is 15$Class B Seat Cost is 12$Class C Seat Cost is 9$And we need t...


Q: Code needed for the following: Use the final numerical grade to look up the corresponding letter gra...

A: This C++ program obey the following rubrics: -In main method – Declaring and initializing the variab...


Q: In JavaScript, how can you validate a user’s input to make sure it is both a number and between 20 a...

A: JavaScriptitis a web programing is a cross- platform language.Its code is integrated wit...


Q: Using Java Eclipse IDE  (Average an array) Write two overloaded methods that return the average o...

A: Program Instructions:Take 10 double values using scanner class in an array.Call the method average w...


Q: Given the following snippet of C++ code: int int1 = -125;unsigned int uInt1 = int1;float float1 = in...

A: ConceptWhenever a negative number is assigned to a variable of any datatype, that number is first co...


Q: in python 2. Now write a program named that reads and displays the data in friends.txt...

A: The following python program is created that reads and displays data in a file named as friends.txt ...


Q: (check all that apply) Which of the following is true about constraint names?A) it can be used for D...

A: A) it can be used for DBA to identify a constraint easily:Yes. Constraints are the rules that are ap...