Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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);

}

}

Java, Programming

  • Category:- Java
  • Reference No.:- M93044648
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As