Assume the following declarations and initializations (MIN, MAX, num) are made just before each sub-question 1 to 15. What is the output each code?  final int MIN = 10, MAX = 20;int num = 15;1. while (num < MAX) {System.out.print(num + “ “);num++;}2. while (num < MAX) {num++;System.out.print(num + “ “);}3. do {num++;System.out.print(num + “ “);} while (num <= MAX);4. while (num < MAX) {System.out.print(num + “ “);num--;}5. while (num > MIN) {System.out.print(num + “ “);num--;}6. while (num < MAX) {System.out.print(num + “ “);num += 2;}7. while (num < MAX) {if (num%2 == 0)System.out.print(num + “ “);num++;} 8. do {num = num + 1;if (num * 2 > MAX + num)System.out.print(num + “ “);} while (num <= MAX);9. for (int value = 0; value >= 7; value++)System.out.print(value + “ “);10. for (int value = 7; value < 0; value--)System.out.print(value + “ “);11. for (int value = 1; value >= 20; value+=4)System.out.print(value + “ “);12. for (int value = num; value <= MAX; value++)System.out.print(value + “ “);13. for (int value = num; value <= MAX; value++)if (value%4 != 0)System.out.print(value + “ “);14. for (int value = MIN; value <= MAX; value++)if (value%4 == 0 && value%5 != 0)System.out.print(value + “ “);15. for (int value = MAX; value >= MIN; value -= 3)System.out.print(value + “ “);

Question

Assume the following declarations and initializations (MIN, MAX, num) are made just before each sub-question 1 to 15. What is the output each code? 

final int MIN = 10, MAX = 20;
int num = 15;
1. while (num < MAX) {
System.out.print(num + “ “);
num++;
}
2. while (num < MAX) {
num++;
System.out.print(num + “ “);
}
3. do {
num++;
System.out.print(num + “ “);
} while (num <= MAX);
4. while (num < MAX) {
System.out.print(num + “ “);
num--;
}
5. while (num > MIN) {
System.out.print(num + “ “);
num--;
}
6. while (num < MAX) {
System.out.print(num + “ “);
num += 2;
}
7. while (num < MAX) {
if (num%2 == 0)
System.out.print(num + “ “);
num++;
}

8. do {
num = num + 1;
if (num * 2 > MAX + num)
System.out.print(num + “ “);
} while (num <= MAX);
9. for (int value = 0; value >= 7; value++)
System.out.print(value + “ “);
10. for (int value = 7; value < 0; value--)
System.out.print(value + “ “);
11. for (int value = 1; value >= 20; value+=4)
System.out.print(value + “ “);
12. for (int value = num; value <= MAX; value++)
System.out.print(value + “ “);
13. for (int value = num; value <= MAX; value++)
if (value%4 != 0)
System.out.print(value + “ “);
14. for (int value = MIN; value <= MAX; value++)
if (value%4 == 0 && value%5 != 0)
System.out.print(value + “ “);
15. for (int value = MAX; value >= MIN; value -= 3)
System.out.print(value + “ “);

Expert Answer

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Engineering Q&A

Find answers to questions asked by student like you

Q: Im using python and i need to 1)Fill the function definitions 2) Fill in the missing code in main() ...

A: Program Instructions:Use math.pi to calculate the area and circumference of the circle.Use ‘“{:,.2f}...

Q: How Technology can help to develop more effective policy?  (Information technology in Global Economy...

A: Information technology:Information technology(IT) has become a very important part of every business...

Q: Imagine you’d like a contractor to build a software application for you that operates like Windows C...

A: Since there are multiple questions and no specification as to which question needs to be solved, her...

Q: I need  crow ERD Model with PK, FK and Referential integrity Arrow Electronics is a consumer electro...

A: The 8 entities are indicated below with only their unqiue identifier (underlined) and one or more ot...

Q: Provide a physical block diagram for a concept of an autonomous transportation and/or delivery that ...

A: Autonomous Vehicle Hardware:The hardware components allow the car to complete such tasks as seeing t...

Q: What is the output of the following code? def test_func (*a) print (a[0]) test_func1,2,3,4) test fun...

A: Consider the given code:#Function definition test_func()def test_func(*a):    #Print the output    p...

Q: Write a class, VoteAge, which does the following:a. Ask the user to enter their age (ex. XX)b. Get t...

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...

Q: Assignment: Carefully read the instructions and write a program that reads the following information...

A: The following program is compiled in replit and also Eclipse.Pseudo code:Get the inputs from the use...

Q: Based on a decision tree structure - what are three decisions that may be applicable to a project? w...

A: A decision tree is a supervised learning technique which acts as a decision support tool. It forms a...

Q: Why is binary search algorithm better than sequential search?

A: Sequential search algorithm involves visiting each and every element of the list of elements and see...

Q: WRITE A JAVA PROGRAM that perform the Insertion Sort, Bubble Sort, Merge Sort, and Quick Sort algori...

A: Program Instructions:Create four methods named insertionSort(), bubblesort(), mergesort() and quicks...

Q: Which of the following code is used to check the web worker object is exists or not? if the web work...

A: The below given code snippet is used to check whether the web worker object is exist or not and if t...

Q: What is the CPU time if the number of instructions executed by the program is 500 cycles per instruc...

A: CPU time:The formula for computing the CPU time is provided below:

Q: Which of the following statements are true? In PC relative addressing mode, the PC and constant need...

A: In PC relative addressing mode, the effective or branch address is obtained by adding offset to PC t...

Q: Hello, I am trying to write a program: Write a .py file like MainFiles.py In that .py, create a func...

A: A python file is created named as MainFiles.py:Def main( ):Print(“ Welcome to python”)The above pyth...

Q: Multiple industries are considering the conversion of existing vehicles to autonomously operated veh...

A: Solution:Multiple industries are considering the conversion of existing vehicles to autonomously ope...

Q: Based on Program.Py below, define and describe a soft process (using a process model), which you wil...

A: Solution:Process model:The software process contains the four activities such as software specificat...

Q: I need help with this problem I attatched the sample output Exempt You will be writing a program to ...

A: Program plan:Display the welcome statementGet the average value from the user and check the average ...

Q: note which line the user inputs and presses enter• area = radius * radius * pi• volume = area * leng...

A: The algorithm for the program would be as below:Declare 4 float variables for accepting user input a...

Q: A sequential circuit has an input (X) and two outputs (S and V). X represents a 4-bit binary number ...

A: Solution:The following code is described about the behavioral Verilog description for given state gr...

Q: 1. What is the output of the following code? public class Loopy {public static void main(String[] ar...

A: 1.Explanation for the given java code:In the class "Loopy", variable "x" is declared and initialized...

Q: public class TestAverage {public static void main(String[] args) {int test1, test2, test3, sum;Scann...

A: The objective of the program is to calculate the average, now since the variable which holds the ave...

Q: a. Assuming that x is 1, show the result of the following Boolean expressions.(true) &amp;&amp; (3 &...

A: a. The result for the following Boolean expressions:Assuming x = 1(true) &amp;&amp; (3 &gt; 4)3 is n...

Q: Are all nonfunctional requirements equally important?  Why or why not?

A: Justification:“Yes”, All non functional requirements are equally important.

Q: how can I create comments in python?

A: In python, # character is used to start the single line comments. Place a hash symbol in front of a ...

Q: Reliability and safety are related but distinct dependability attributes. Describe two important dis...

A: Reliability: It refers to “quality changing over time “ means reliability always varies over time, i...

Q: What is the new sematic elements in HTML5? 111 <mark iv a. i and iv b. iand iii c. i, ii and iv d....

A: Out of the given options, the semantic elements of HTML5 are&lt;details&gt;&lt;nav&gt;&lt;mark&gt;He...

Q: Write a program in Eclipse called LoopMinMax that reads in 4 values from the user and prints the low...

A: Algorithm: The program has the following algorithm:The class name is “LoopMinMax” and in the main me...

Q: How would I solve this problem in python language Grades a) Write a program that reads in the names ...

A: Program Instructions:Use the open() function to read from the file.Save the result o spilt() functio...

Q: Hello! Write a C++ Program that simulates a basic calculator using functions which performs the oper...

A: Solution:Given data,The C++ code to perform the calculator operations using function is given below:...

Q: write a program to convert between KPHand MPH in either direction.If you are driving across the bord...

A: Hey..We have following important points to solve this problem using java programming:We are using  s...

Q: how do you known when you need to use int and float? I know that int refers to intergers and float r...

A: “input” keyword in Python:In Python, the function which is used to read the input from the keyboard ...

Q: What values will print? Use Eclipse to verify it • Only write the answerdouble x = Math.sqrt(4);Syst...

A: Solutions://Define the classpublic class Example{     //Define the main() method     public static v...

Q: Identify the errors in the following program. 2 errorspublic class Test {public static void main(St...

A: The two errors in the given program are:The argument is passed in wrong order in the line nPrintln(5...

Q: Match the following 1) BRANCHING 2) AIRTHMATIC 3) DATA TRANSFER 4) CONTROL TRANSFER Note: Instructio...

A: TRAP:TRAP instruction changes the program counter to an operating system “service routine”.When TRAP...

Q: In Eclipse write a loop which asks 5 integers from user (Scanner) and calculates and prints their av...

A: To input integer value from the scanner class   you need to use Scanner  class which is declared in ...

Q: What is the output of the following code? !doctype html> Find the output ax3 + b2 - c abc ...

A: HTML math tag is used to insert MathML elements inside a webpage. With in &lt;msup&gt; tag those cha...

Q: Use Eclipse for this program

A:  Step 1: Import required package.Step 2: Define “AnalyzeNumbers” class.Step 3: Define main function....

Q: For do this program you need to use Eclipse  Write a program called AveMethod (main method) that con...

A: Program plan:Define the class “AveMethod”.Define the class “main”Create an object for scanner class....

Q: Write a program called HeadsOrTails, that lets the user guess whether the flip of a coinresults in h...

A: The following variables used:coin to hold the value of random flipcoinString to hold the text value ...

Q: Imagine you’d like a contractor to build a software application for you that operates like Windows C...

A: Statement of objectives (SOO):It provides an overall objective which serves as the basis for the sta...

Q: this is a problem that I have how would I go about solving it?Im using python so please put the answ...

A: Algorithm: Initializes the seat prices for class A, B and CDefine main function.Display message stat...

Q: How do I write a code that places my name in an email link? Thanks

A: As there is no particular programming language mentioned, we are doing this using HTML code.

Q: How would i solve this question? I have the sample output but how do I make it? Write a program in p...

A: Program Instructions:Create a menu using print() function and use while loop to repeatedly show the ...

Q: Consider the window size is 10, bandwidth is 1500 bps, transmission delay is 2 ms and propagation de...

A: Formula for Throughput:In Go-back-N protocol, the formula for computing the throughput is given belo...

Q: I need help figuring out how to summarize the content and format of a written technical report.

A: While we are writing a technical report we need to figure out the following points.The title page of...

Q: Write a program in Eclipse that contains 2 methods, main and printLine.

A: Program plan: Import necessary packages.Define a class named “PrintCheck”.Define a method called “pr...

Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb....

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...

Q: Which of the following is true? I. The 80/20 rule states that 80% of the instruction is executed and...

A: 80/20 rule was first introduced by Vilfredo Pareto and therefore in also commonly known as Pareto pr...

Q: Write a program called StudentTable that prints the below table. Use only print() orprintf(). DO NOT...

A: The program in Java would be using print and printf statements with formatting for left alignment of...