#, 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:- #

How dos attack is a cyber crime what cyber crime can be used, How DoS attac...

How DoS attack is a cyber crime? For what cyber crime can be used? DoS stands for Decline of Service and it is a cyber crime as it jams and within a few cases shut down the goa

Carbon Footprint Applications, 10.13 (CarbonFootprint Interface: Polymorphi...

10.13 (CarbonFootprint Interface: Polymorphism) Using interfaces, as you learned in this chapter, you can specify similar behaviors for possibly disparate classes. Governments and

Interfaces and generics, In this assignment, you are provided with an inter...

In this assignment, you are provided with an interface that contains a generic type. You are asked to create two classes that implement this interface. A. The Sequenced Interfac

Code, Alia is appearing for the board exams. In order to qualify for the ne...

Alia is appearing for the board exams. In order to qualify for the next class Alia need to get exactly X credits. In current semester Alia has to study N number of subjects, and ev

Polymoethism, write a java program to test for class Person Student facult...

write a java program to test for class Person Student faculty Employee

Luminus jewels, Luminous Jewels - The Polishing Game Byteland county is ve...

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

Program implement class which have main string method, Implement the Money ...

Implement the Money class discussed in class. This class should represent a dollar and cents amount with 0-99 cents and the cents being the same sign as the dollars. The class shou

Information retrieval from multi-agent system, Information Retrieval from M...

Information Retrieval from Multi-Agent System with Data Mining in Cloud Computing I have proposed one research model on "Information Retrieval during Multi-Agent System with Dat

Texas holdem poker java game source code, Texas Hold'em Poker Java Game Sou...

Texas Hold'em Poker Java Game Source Code Project Description: I am seeking Java source code for a Texas Hold'em Poker game. The game could have client and server side mod

What are the sub categories of ai explain, What are the Sub categories of A...

What are the Sub categories of Artificial Intelligence? Briefly explain any two. 1. Robotics :  These are the machines that are computer programmed and perform work that was pr

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