What value will be output first

Assignment Help JAVA Programming
Reference no: EM132057172

Refer to the attached Java program. Walk through the program. Do not compile or run it! You may use any text as a reference.

1. What value will be output first?

a. Odd

b. Even

c. OOPS

d. 10

e. none of the above

2. What value will be output second?

a. Odd

b. Even

c. OOPS

d. 5

e. none of the above

3. What value will be output third?

a. Odd

b. Even

c. OOPS

d. 5

e. none of the above

4. What value will be output fourth?

a. Odd

b. Even

c. OOPS

d. 0

e. none of the above

5. What value will be output fifth?

a. Odd

b. Even

c. OOPS

d. 6

e. none of the above

6. What value will be output sixth?

a. Odd

b. Even

c. OOPS

d. 3

e. none of the above

7. What value will be output seventh?

a. 4

b. 5

c. 6

d. 7

e. none of the above

8. What value will be output eighth?

a. 4

b. 4.0

c. 4.8

d. 8.4

e. none of the above

9. What value will be output ninth?

a. 0

b. 3

c. 6

d.10

e. none of the above

10. What value will be output tenth?

a. 1

b. 3

c. 5

d. 10

e. none of the above

Data for Quiz# 11

Input from the following collection in order as required: {10, 5, 0, 6, 3, 4, 1, 7}

Import.java.io.*;

Public class Quiz11Driver

{

Public static void main (string args []) throws IOException

{

Quiz 11 app;

App = new Quiz11();

App.appMain();

}

}

Class Quiz11

{

BufferedReader stdin;

Int count, tot, min, x, y, mincount;

Float avg;

Public void appMain() throws IOException

{

rptInit();

for (count = 1; count <-5; count++)

{

loopA();

}

--count;

Avg = total/count;

rptOut();

}

void rptInit()

{

Stdin = new BufferedReader (new InputStreamReader (system.in));

Tot = 0;

Min = 100;

}

void loopA() throws IOException

{

Getinput();

Y = x%2;

updateLoop();

checkIn();

}

Void getInput () throws IOException

{

System.out.print("Enter a whole number:");

X = Integer.parseInt(stdin.readLine());

}

Void updateLoop()

{

Tot += x;

If (x < min)

{

min = x;

minCount = count;

}

}

Void checkIn()

{

Switch (y)

{

Case 0:

System.out.println("Even");

break;

Case 1:

System.out.println("Odd");

break;

default:

System.out.println("OOPS");

break;

}

}

Void rptOut()

{

System.out.println(tot);

System.out.println(count);

System.out.println(avg);

System.out.println(min);

System.out.println(minCount);

}

}

Reference no: EM132057172

Questions Cloud

Compound relational operators-weekly tax withholding : Create a program that will calculate the weekly average tax withholding for a customer, given the following weekly income guidelines:
Program that interviews the users about name : I need a program that interviews the users about their name, how many houses they have and what the purchase price was for each of their houses.
What are the key constructs required to createa loop : What are the key constructs required to createa loop? Identify two scenarios that may require two different types of loops.
Design a program that uses a loop to display : Design a program that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes.
What value will be output first : Refer to the attached Java program. Walk through the program. Do not compile or run it! You may use any text as a reference.
Application you choose and the class within that application : Describes the application you choose and the class within that application. Identify one or two key distinctions within that class that would prompt you
Define a two-dimension array : 1. Define a two-dimension array with 10 rows and 2 columns.
Constructive feedback on the criteria : Actively participate in this discussion by providing constructive feedback on the criteria, rationales, and examples posted by your peers.
Populate the array elements with random values : Provide the specific Java nested loop you would use to populate the array elements with random values.

Reviews

Write a Review

JAVA Programming Questions & Answers

  What is wrong with the given syntax

What is wrong with the following syntax? One of the three steps necessary to create a rolling banner is to create an __________ object. The __________ HTML tag is a form element used to define a selection list.

  Latin squares - puzzle

Solve button causes the program to display a single solution by using only the symbols from the top row of six text fields in such a way that the non-empty grid symbols are not altered.

  Write program that play rock-paper-scissors-lizardspock game

Write a program that plays the Rock-Paper-Scissors-Lizard-Spock game. Refer to http://en.wikipedia.org/wiki/Rock-paper-scissors-lizard-Spock for more information.

  Why is overloading useful

Overloading is a way of using the same method name for multiple methods as long as the number / types of arguments are different. Why is overloading useful? Give an example of how this could be used.

  Design a solution to the problem by using the five steps to

the software needs to allow the restaurant owner to schedule employees for up to 40 hours in a seven-day week. the

  Write java codes to implement the viterbi algorithm

In this programming assignment, you are asked to write Java codes to implement the Viterbi algorithm for HMM Tagging

  Write a program which reads a file of genealogy information

Write a program which reads a file of genealogy information and then allows the user to enter pairs of names X and Y.

  What is mean by swing and awt

What is mean by Swing and AWT and compare the statements break and continue with example in terms of their functions

  Write a separate method to handle this task

In this assignment you use an abstract class to represent a bank account and concrete classes to represent a checking account and a savings account - Your program must have the capability to convert inputs to and from integer cent amounts. Write a..

  Write a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  What are other reasons for data files

program does not have run all the time and when your computer is rebooted the state of the data is preserved. What are other reasons for data files?

  Create a program called date java to perform

Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year. Also, provide a method nextDay() to increment the day by one. The Date object should always remain in a consistent state.

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