answer.
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
Komok [63]
2 years ago
6

Java Programming home > 1.14: zylab training: Interleaved input/output Н zyBooks catalog Try submitting it for grading (click

"Submit mode", then "Submit for grading"). Notice that the test cases fail. The first test case's highlighting indicates that output 3 and newline were not expected. In the second test case, the-5 and newline were not expected 2 Remove the code that echoes the user's input back to the output, and submit again. Now the test cases should all pass 0/2 ACTIVITY 1.14.1: zylab training: Interleaved input/output DoubleNum.java Load default template 1 import java.util.Scanner; 3 public class DoubleNum public static void main(String args) { Scorner sehr = new Scanner(System.in); int x; 7 System.out.println("Enter x: "); 9 - scnr .nextInto: 10 11 System.out.println(); // Student mistakenly is echoing the input to output to match example 12 System.out.println("x doubled is".02 Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed Input values in the first box, then click Run program and observe the programs cutout in the second be Enter program input (optional) of your code requires input values, provide them here Ad Cat
Computers and Technology
1 answer:
Andru [333]2 years ago
5 0

Answer:

The following are the code to this question:

code:

System.out.println(x);  //use print method to print value.

Explanation:

In the given question, it simplifies or deletes code in the 11th line. This line has a large major statement.  

In the case, the tests fail because only 1 line of output is required by the tester, but two lines are obtained instead.

It's to demonstrate that the input/output or testing requirements function throughout the model.

You might be interested in
Robin wants her presentation to move from one slide to another with special motion effects. Which option should Robin use?
topjm [15]
If this is in power point, then she should use the <em>transitions </em>tab on the ribbon. =)
3 0
2 years ago
Read 2 more answers
Your computer has a quad-core processor that supports multithreading installed. given that the system is running windows, how ca
AlexFokin [52]
By using cpu-z or the performance ran in taskmgr
8 0
2 years ago
The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz
dangina [55]

Answer:

The method definition to this question can be given as:

Method definition:

public void clear(int[] arr, int num) //define method clear.

{

   if (num == 0) //if block

{

       return 0;  return value.

}

else //else block

{

 arr[num - 1] = 0; //assign value in arr.

return arr[];  //return value.

}

}

clear(arr, num - 1);   //calling

Explanation:

The description of the above method definition as follows:

  • Firstly we define a method that is "clear" that does not return any value because its return type is "void". This method accepts two integer variables that are "arr[] and num" where arr[] is an array variable and num is an integer variable.
  • Inside a method, we use a conditional statement in if block we check that num variable value is equal to 0. if this condition is true so, it will return 0 otherwise it will go to else block in else block it will assign value in variable arr[num-1] that is "0" and return arr value.

4 0
2 years ago
Which of the following is ideal for long distance communication ?
Vinvika [58]
Microwave transmission is ideal for long distance communication. It is so good that it is used for satellite and space probe communication.
3 0
2 years ago
Write a method called fact that recursively calculates the factorial value of its single int parameter. The value returned by fa
andrey2020 [161]

Answer:

The program to this question can be given as follows:

Program:

//class

public class factorial //defining class

{

//method fact

public static long fact(int x1) //defining method fact

{

//conditional statement

if (x1 <= 1) //if block checks parameter value less then equal to 1

{

return 1; //return value

}

else //else part

{

return (fact(x1 - 1) * (long) x1); //return factors using recursive function

}

}

//method main

public static void main(String[] args) //defining main method

{

long data=fact(5);//defining variable that holds function value

System.out.println("Factorial is: "+data); //print value

}

}

Output:

Factorial is: 120

Explanation:

In the above java program, a class is "factorial" is defined, inside the class, a static method "fact" is declared, that accepts an integer parameter that is "x1" and returns a long value, inside this method a conditional statement is used.

  • If the block it checks parameter value is less then equal to 1, if this condition is true, it will return 1 when this condition is not true. It will go in else part.
  • In else part, it uses a recursive function to calculate factorial of a number and return its value.
  • Then the main method is defined, inside this method a long variable "data" is defined, that call and holds fact function return value, and in the next line, the print function is used to print the data variable value.

6 0
2 years ago
Other questions:
  • Allows you to manually add an entry to the arp cache that resolves the ip address inetaddr to the physical address etheraddr. wh
    13·1 answer
  • Compare the encryption algorithms found in s-tools: idea, mdc, des, and 3des.
    5·1 answer
  • An mp3 takes up about 16 kilobytes of memory per second of music. if you owned a one terabyte hard drive and filled it with only
    15·1 answer
  • 1. What is the global marketplace?
    11·2 answers
  • Prompt: Which references and reference formats are you most likely to use? Why?<br><br><br> ED2020
    13·2 answers
  • Given a pattern as the first argument and a string of blobs split by | show the number of times the pattern is present in each b
    14·1 answer
  • Write a C program that inputs four strings that represent integers, converts the string to integers, sums the values and prints
    10·1 answer
  • Create an abstract Division class with fields for a company's division name and account number, and an abstract display() method
    14·1 answer
  • Create a stored procedure named prc_inv_amounts to update the INV_SUBTOTAL, INV_TAX, and INV_TOTAL. The procedure takes the invo
    8·1 answer
  • What does the binary odometer show about representing large numbers​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!