Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The question is what do I do? what does this java script do? package clsQuiz2; import java.util.Scanner; public class clsQuiz2 { public static void main(String[]

The question is "what do I do?" what does this java script do?

package clsQuiz2; import java.util.Scanner;

public class clsQuiz2 { public static void main(String[] args) { // TODO Auto-generated method stub

Scanner srcData = new Scanner (System.in); String strInput="proceed", str="hello"; int intResult=0; System.out.println("What do i do?"); str.equalsIgnoreCase(str); while (!strInput.equalsIgnoreCase("quit")) { System.out.println("enter a number > 0"); intResult+=intDoSomething(srcData.nextInt()); System.out.println(intResult); if (blnBingo(intDo(intResult))) { System.out.println("You made it, you stopped me =("); strInput="quit"; } else { System.out.println("reset, quit, or proceed?"); strInput = srcData.next(); } if (strInput.equalsIgnoreCase("reset")) intResult=0;} srcData.close();} public static boolean blnBingo (int intVal) { if (intVal==90) return true; else return false;} public static int intDo(int intValue) { int intCounter=0; intValue+=intValue%2; while (intCounter++ <= intValue--) {} intValue= --intCounter-1; return intValue;} public static int intDoSomething(int intValue) { int intSendMeBack=0; for (int intWonder = intValue; intWonder>0; intWonder--) intSendMeBack+=intWonder; return intSendMeBack; } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

ISBN: 0805302441, 978-0805302448

More Books

Students also viewed these Databases questions