Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 26 (12 points) Saved Which statement could be used to generate a random number between 1 and 6, inclusive, and assign it to the

Question 26 (12 points)

Saved

Which statement could be used to generate a random number between 1 and 6, inclusive, and assign it to the variable dice? (2 points)

Question 26 options:

1)

int dice = Math.random(6);

2)

int dice = Math.random(6) + 1;

3)

int dice = Math.random() * 6;

4)

int dice = (Math.random() * 6) + 0.5;

5)

int dice = (int)(Math.random() * 6) + 1;

Question 27 (12 points)

Saved

Suppose a class named SportsCar is a subclass of a class called Automobile. Automobile has only two methods: accelerate and addGas. Which statement is true? (2 points)

Question 27 options:

1)

A SportsCar object has the methods accelerate and addGas only. No other methods are allowed, since no other methods are inherited.

2)

A SportsCar object has at least the methods accelerate and addGas. It might add its own methods.

3)

A SportsCar object has the methods accelerate and addGas only if it is cast to Automobile.

4)

A SportsCar object has the methods accelerate and addGas only if they are static.

5)

A SportsCar object has the methods accelerate and addGas only if they are abstract.

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_2

Step: 3

blur-text-image_3

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

What is the primary difference between editing and revising?

Answered: 1 week ago

Question

Challenges Facing Todays Organizations?

Answered: 1 week ago