Write a counter-controlled while loop that uses the loop

Assignment Help JAVA Programming
Reference no: EM132083485

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 I NEED SCREEN SHOTS CONTAINING SOURCE CODE, MY NAME(Hamraj selemani), MY CLASS(705) & JAVA FILE``*.

Part 1.

In this lab, you use a counter-controlled while loop in a Java program provided with the data files for this boo(i.e Newmultiply.Java) . When compiled, the program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. The data file contains the necessary variable declarations and output statements.

1. Open the source code file named Multiply.java using Notepad or the text editor of your choice.

2. Write a counter-controlled WHILE LOOP that uses the loop control variable by 2 and by 10. Remember to initialize the loop control variable before the program enters the loop.

3. In the body of the loop, nultiply the value of the loop control variable by 2 and by 10. Remember to change the value of the loop control variable in the body of the loop.

4. Save the source code file in a directory of your choice, and then make that directory your working directory.

5. Compile the source code file, Multiply.java.

6. Execute the program. Record the output of this program.

Lab Part 2.

In this lab, you work with the same Java program you worked with in Part 1, the completed program should print the numbers 0 through 10, along with their values multiply by 2 and by 10. However, in this lab, you should accomplish this using a for loop instead of a counter-controlled WHILE-LOOP.

1. Open the source code file named '' NewMultiply.java`` using Notepad or text editor of your choice.

2. Write a for loop that uses the loop control variable to take on the values o through 10.

3. In the body of the loop, multiply the value of the loop control variable by 2 and by 10.

4. Save this source code file in a directory of your choice, and then make that directory your working directory.

Reference no: EM132083485

Questions Cloud

What are the greatest influence on our value system : But each of us has different values. Where do values come from? What, or who, are the greatest influence on our value system?
Determine the net present value : Hsung Company accumulates the following data concerning a proposed capital investment: cash cost $171,844, Determine the net present value
What is the annual coupon rate the company : What is the annual coupon rate the company would pay on the newly issued bond? Should company call the bond and refinance?
Calculate the value of this investment at the end : Assume that an investor invested $1 in 2005, calculate the value of this investment at the end of 2012. (Round to 4 decimals).
Write a counter-controlled while loop that uses the loop : Write a counter-controlled WHILE LOOP that uses the loop control variable by 2 and by 10.
Explain your findings : prepare a multiple-step incomestatement for the year ended December 31, 2007 - state the formula you are using, show your computations,and explain your findings
Calculate gross profit and the gross profit ratio for year : Net sales for the year were $500,000 and cost of goods sold was $295,000 for the company's, Calculate gross profit and the gross profit ratio for the year
Design a usability questionnaire : Next you will design a usability questionnaire , administer it to at least 3 subjects, perform analysis on their responses, and compile a usability report.
Investment in the machine attractive in economic terms : Is the investment in the machine attractive in economic terms?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd