


Newmultiply.Java
// NewMultiply.java - This program prints the numbers 0 through
10 along
// with these values multiplied by 2 and by 10.
// Input: None.
// Output: Prints the numbers 0 through 10 along with their values
multiplied by 2 and by 10.
public class NewMultiply
{
public static void main(String args[])
{
String head1 = "Number: ";
String head2 = "Multiplied by 2:
";
String head3 = "Multiplied by 10:
";
int numberCounter; //
Numbers 0 through 10.
int byTen;
// Stores the number multiplied by 10.
int byTwo; // Stores
the number multiplied by 2.
final int NUM_LOOPS = 10; //
Constant used to control loop.
// This is the work done in the
housekeeping() method
System.out.println("0 through 10
multiplied by 2 and by 10" + "\n");
// This is the work done in the
detailLoop() method
// Write for loop
// This is the work done in the
endOfJob() method
System.exit(0);
} // End of main() method.
} // End of NewMultiply class.
NOTE.
Please my teacher needs to see---- Screen Shot of the executed program showing that it worked ( a JPG or such file), and a SOURCE CODE (in a WORD doc or such) and a JAVA file, my source code, PROOF that my program compiles AND PROOF that it PRODUCES the proper OUTPUT. Please have the followingDISPLAYED WITHIN the SOURCE CODE file, near the top (so that he will see it when he print out the file).
My name Hamraj Selemani
class # 705
Lab # 5
PLEASE I NEED SCREEN SHOTS CONTAINING SOURCE CODE, MY NAME(Hamraj selemani), MY CLASS(705) & JAVA FILE.
While Loop
/*
Here I have initialised loop control variable with 1.
because initializing it to 0 will lead to an infinite loop
execution
because 0*2*10=0
so loop will never stop.
*/
public class NewMultiply {
public static void main(String a[]){
int loopController=1; //loop
control variable
while(loopController<10){
loopController=loopController*2*10;
}
System.out.println("Loop control
variable: "+loopController);
}
}
![Servers?Console X <terminated> NewMultiply [Java Application] C:LPr Loop control variable: 20](http://img.homeworklib.com/questions/d093d690-ca02-11ea-87f1-a1d18941f021.png?x-oss-process=image/resize,w_560)
For Loop
public class NewMultiply {
public static void main(String a[]){
int ans=0;
for(int
loopController=0;loopController<10;loopController++){
loopController=loopController*2*10;
ans=loopController;
}
System.out.println("Loop control
variable: "+ans);
}
}
Output:
![Servers Console X <terminateds NewMultiply [Java Application] Loop control variable: 20](http://img.homeworklib.com/questions/d0ef93f0-ca02-11ea-8a95-b7cdd3774b8d.png?x-oss-process=image/resize,w_560)
Newmultiply.Java // NewMultiply.java - This program prints the numbers 0 through 10 along // with these...
Summary In this lab the completed program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. You should accomplish this using a for loop instead of a counter-controlled while loop. Instructions Write a for loop that uses the loop control variable to take on the values 0 through 10. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. Execute the program and...
Can someone help me with this Python code Summary In this lab, you work with the same Python program you worked with in Labs 5-1 and 5-3. As in those earlier labs, the completed program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. However, in this lab you should accomplish this using a while loop with a break statement. Instructions Make sure that the file NewestMultiply.py is selected and open. Write...
In this lab, you complete a partially written Java program that includes two methods that require a single parameter. The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a method that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another method that computes the product of all the whole numbers up to...
In this lab, you complete a partially written Java program that includes two methods that require a single parameter. The program continuously prompts the user for an integer until the user enters 0. The program then passes the value to a method that computes the sum of all the whole numbers from 1 up to and including the entered number. Next, the program passes the value to another method that computes the product of all the whole numbers up to...
In this lab, you complete a partially written Java program that includes methods that require multiple parameters (arguments). The program prompts the user for two numeric values. Both values should be passed to methods named calculateSum(), calculateDifference(), and calculateProduct(). The methods compute the sum of the two values, the difference between the two values, and the product of the two values. Each method should perform the appropriate computation and display the results. The source code file provided for this lab...
Assignment: Write a program that prompts the user to enter 10 numbers, and then displays the mean and standard deviation of these numbers I already have the source code all done. I just need this translated into a flowchart. Again I just need the flowchart, not any source code. I have already provided the source code below. Need Flowchart version of my code Here is the source code: public class Mean_Standard_Deviation { public static void main(String[] args) { ...
JAVA HELP: Directions Write a program that will create an array of random numbers and output the values. Then output the values in the array backwards. Here is my code, I am having a problem with the second method. import java.util.Scanner; import java.util.Random; public class ArrayBackwards { public static void main(String[] args) { genrate(); print(); } public static void generate() { Scanner scanner = new Scanner(System.in); System.out.println("Seed:"); int seed = scanner.nextInt(); System.out.println("Length"); int length = scanner.nextInt(); Random random...
Write a program that will check a Java file for syntax errors. The program will ask for an input-file name and output-file name and will then copy all the code from the Java input file to the Java output file, but with the following changes: 1. Any syntax error found in the Java input file will be corrected: a. Missing semicolon b. Missing compound statements (curly braces) c. All comments have to start with // and end with a period....
In java, write a program that gets 10 integer numbers from the user using user input, and then calculates and display the sum of the numbers that have been read. Program Requirements: Write the program in three versions with three loops. Put all three loops in the main method of your source code. The program must be in one file. version1: use a while loop. version2: use a do-while loop. version 3: use a for loop. For each version, use a loop to...