#, JAVA Programming

Assignment Help:
Consider the following code? What input is needed for x in order for the sum variable that is output at the end of the code to be 12 ?

(In other words: what do I need to make X be in order for sum to be 12)

X is an int, so please keep answers to whole numbers.

Scanner s = new Scanner(System.in);
int sum = 0;
int y = 3;
int x = s.nextInt();
do{
x--;
if (x < 3)
continue;
sum += y;
}while (x > 0);
System.out.println(sum);

Related Discussions:- #

Java application to simulate a bank system, Write a Java application to sim...

Write a Java application to simulate a bank system. In the system, customers can open new bank accounts with the bank, and register/use an online account to manage their bank accou

What is includeaction, The IncludeAction class is useful when you require t...

The IncludeAction class is useful when you require to integrate Struts into an application that uses Servlets. Use the IncludeAction class to contain another resource in the respon

Simon game project, i''m trying to make a code to make the simon says game ...

i''m trying to make a code to make the simon says game and i can''t figure it outt

What is an introduction in aop, An introduction permits the user to add new...

An introduction permits the user to add new methods or attributes to an existing class. This can then be explained to an existing class without having to change the structure of th

Prepare a small android application, Android App Project Description: ...

Android App Project Description: I am seeking an experienced individual to prepare a small android application The only difference is that I would like movement to be done

Applet program, file download from server using applet and tomcat server

file download from server using applet and tomcat server

Statements and operators, Operator Functionality E x...

Operator Functionality E x ample/Explanation = Sets one value equal to another counter=0  Sets the counter to equivale

The fancy new French restaurant La Food is very popu, The fancy new French ...

The fancy new French restaurant La Food is very popular for its authentic cuisine and high prices. This restaurant does not take reservations. To help improve the efficiency of the

Rmi client program, In a RMI Client Program, what are the excpetions which ...

In a RMI Client Program, what are the excpetions which may have to handled Ans) a. MalFormedURLException b. NotBoundException c. RemoteException

Java collection framework., #question.Write a program that computes the edi...

#question.Write a program that computes the edit distance (also called the Levenshtein distance, for its creator Vladimir Levenshtein) between two words. The edit distance between

Write Your Message!

Captcha
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