Run the code

Assignment Help JAVA Programming
Reference no: EM13768708

Question 1

1. Run the following code:

Int I =2147389549;
Boolean flag = true;
While(flag){
System.out.println(i);
i=i+1;
}

2. Explain the loop;

3. Explain the output aYer you let it run 20 seconds, 5 minutes, 10 minutes.

Question 2

1. Run the following code:

Int I =2147389549;
Boolean flag = true;
While(flag){
System.out.println(i);
If(i==0) i=i+1;
Else if (i<0) flag = false;
Else i++;}

2. Explain the output;

3. What happens if you initialize the value with 2147389548?

4. Fix the loop to stop when i overflows.

5. Run it the modification

Question 3

1. Run the following code:

String ruler1 = "1";
String ruler2 = ruler1 + "2" + ruler1;
String ruler3 = ruler2 + "3" + ruler2;
String ruler4 = ruler3 + "4" + ruler3;
String ruler5 = ruler4 + "5" + ruler4;

System.out.println(ruler1);
System.out.println(ruler2);
System.out.println(ruler3);
System.out.println(ruler4);
System.out.println(ruler5);

2. Set a while loop to do produce the same output.

3. Run it

Reference no: EM13768708

Questions Cloud

Evaluating the pros and cons of multinationalization : Evaluating the pros and cons of multinationalization; and the even more general issue of risk vs, return as manifested in "diversification" on economic activities. Discuss both of these aspects.
Presidential doctrine concept : Describe the effect that the presidential doctrine has had on regional or global affairs since it was announced during the Cold War.
Sports and globalization efforts of professional sports leag : Complete a thorough review on the topics of the business of sports and globalization efforts of professional sports leagues. Organize your two-to-three page paper according to appropriate APA style including a title page and reference page.
Write about ethics as a component of organizational culture : Write a paper about Write a paper on Ethics as a Component of Organizational Culture. Your paper should include an introduction and conclusion that summarize the contents of the entire paper.
Run the code : Run the following code, Explain the output aYer you let it run 20 seconds, 5 minutes, 10 minutes.
Profits and revenues and to gain access : Discuss why firms are attracted to foreign markets, for example, to increase profits and revenues and to gain access to cheaper manufacturing. How may this affect the domestic country of the firm?
International workforce and its impact on strategy : The workforce management is far more complicated in companies with operations in multiple countries than their domestic counterparts. There are political, economic, social-cultural, technological, and legal issues that add substantial challenges t..
Doppler radar, polarized sunglasses, rainbow issues : Explain how doppler radar works. Describe the properties of electromagnetic and interactions that make Doppler radar possible.
Kinds of international strategies : When companies expand into the international arena, they do so either because their home market has matured or because they see real opportunities in the foreign market. Discuss which kinds of international strategies are most appropriate for comp..

Reviews

Write a Review

JAVA Programming Questions & Answers

  The class constructor should accept an array

Write a class named TestScores. The class constructor should accept an array of test scores as its arguments. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater than 10..

  Create an application that uses a graphic interface

Create an application that uses a graphic interface to capture room assignment data for dormitory residents and writes that data to a random access output file.

  Write a program called drawing in the form of a public class

Write a program called Drawing in the form of a public class Drawing that extends a Java JFrame and provides the following features.

  Have an array of integers with user input instead of given

change the current code to have an array of integers with user input intead of given input from the main where it says int[] a=....; And also from a text file but the same numbers as what is given in main.

  Create a method that would search through an arraylist

What is the best way of the following ways (For each, Iterator, While with index) that you would use to create a method that would search through an ArrayList of files for a certain file and then delete it, and why?

  Build the gui layout of the game

Build the Build the GUI layout of the game in java.

  Create a graphical application stackdemogui

Create a graphical application StackDemoGUI that provides a button for push and pop from a stack, a text field to accept a string as input for push, and a text area to show the contents of the stack after each operation.

  Take a position on whether or not an object-oriented

take a position on whether or not an object-oriented approach can be used to develop any type of system. provide two

  Write a program to print out a simplified bill

Write a program to print out a simplified bill. The customer's name, the number of hours of labor, and the cost of parts and supplies should be entered in response to INPUT statements.

  Consider a company that wants to keep track of its employees

Consider a company that wants to keep track of its employees, their positions and their telephone numbers. Your development team has developed a simple prototype using the Java code found in EmployeeDirectory.zip.

  The frantic pipe layer game

Design the Frantic Pipe Layer game

  Solve computer science java validation problem

Computer Science, Operating Systems - Year 1Description:java validationProblem: Using NetBeans 7.2

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