Which of the following are valid java identifiers

Assignment Help Management Information Sys
Reference no: EM131424275

Reading:

1- Think Java: Chapter 1, 2, 3, 8.

2.OCA: Chapter 1, 2, 3

Exercise on paper: (1 points each)

1. Write Java statements that accomplish each of the following tasks:

a) Display the message "Enter an integer: ", leaving the cursor on the same line.

b) Assign the product of variables b and c to variable a.

c) Use a comment to state that a program performs a sample payroll calculation.

2.Which of the following Java statements contain variables whose values are modified?

a) p = i + j + k + 7;

b) System.out.println("variables whose values are modified");

c) System.out.println("a = 5");

d) value = input.nextInt();

3. Given that y = ax3 + 7, which of the following are correct Java statements for this equation?

a) y = a * x * x * x + 7;

b) y = a * x * x * (x + 7);

c) y = (a * x) * x * (x + 7);

d) y = (a * x) * x * x + 7;

e) y = a * (x * x * x) + 7;

f) y = a * x * (x * x + 7);

Following assignments are from OCA: Oracle®Certified Associate Java® SE 8 Programmer I

Ch1- Review Questions

(hint: try out in your java program if not sure)

4.Which of the following are valid Java identifiers? (Choose all that apply)

A. A$B

B. _helloWorld

C. true

D. java.lang

E. Public

F. 1980_s

5.What is the output of the following program?

1: public class WaterBottle {

2: private String brand;

3: private boolean empty;

4: public static void main(String[] args) {

5: WaterBottlewb = new WaterBottle();

6: System.out.print("Empty = " + wb.empty);

7: System.out.print(", Brand = " + wb.brand);

8: } }

G. Line 6 generates a compiler error.

H. Line 7 generates a compiler error.

I. There is no output.

J. Empty = false, Brand = null

K. Empty = false, Brand =

L. Empty = null, Brand = null

6.In the following code block, which of the following are true?

4: short numPets = 5;

5: intnumGrains = 5.6;

6: String name = "Scruffy";

7: numPets.length();

8: numGrains.length();

9: name.length();

(Choose all that apply)

M. Line 4 generates a compiler error.

N. Line 5 generates a compiler error.

O. Line 6 generates a compiler error.

P. Line 7 generates a compiler error.

Q. Line 8 generates a compiler error.

R. Line 9 generates a compiler error.

S. The code compiles as is.

Reference no: EM131424275

Questions Cloud

What is the value of solitary confinement : What is the value of Solitary Confinement and Is solitary confinement a humane approach to the treatment of prisoners? Explain your answer.
What recommendation should be made for more effective system : What steps should be taken to identify specific problems in this practice's telephone system? What recommendations should be made for a more effective and efficient system?
Probability that the voter is not in favor of isolationism : What is the probability that the voter is in favor of isolationism, a female, and a Republican?- What is the probability that the voter is not in favor of isolationism?
Is the australian dollar expected to get stronger or weaker : What do you think about the relative nominal interest rates in the United States and Australia? Relative real rates?
Which of the following are valid java identifiers : Write Java statements that accomplish each of the following tasks:Display the message "Enter an integer: ", leaving the cursor on the same line.Assign the product of variables b and c to variable a.Use a comment to state that a program performs a sam..
Analyze the problem in the scenario : Define the problem in the scenario that you have chosen and Analyze the problem in the scenario - Generate options for solving the problem in the scenario.
Finding negative impacts of gmo : As time goes on, do you believe that we will see a resurgence of the GMO debate, however, this time in favor of their use? Science has seemed incapable of finding negative impacts of GMO's and while their fears seem legitimate, it seems that they..
Favor of expanding international law : Would you be in favor of expanding international law to include international tribunals where companies can sue individuals or vice versa? That would create a level economic playing field but may be contrary to state sovereignty.
Find the probability that exactly two have blue eyes : Find the probability that all four have blue eyes.- Find the probability that none has blue eyes.- Find the probability that exactly two have blue eyes.

Reviews

Write a Review

 

Management Information Sys Questions & Answers

  This post addresses windows 7 and backup terminologybriefly

this post addresses windows 7 and backup terminology.briefly describe the following three types of windows 7 updates

  What is porters five competitive forces model

What is Porters Five Competitive Forces Model? How has IT and the Internet changed the balance of power among these competitive forces? Using an industry of your choice, give examples of companies that represent the five competitive forces?

  Trend reports on the topic information technology

Write five trend reports on the topic Information Technology & business starting with January-December 2015 (nothing earlier) in hard (paper) and soft (electronic file)

  Business and technologycan you help me to get started with

business and technologycan you help me to get started with thistechnology is an important component of the business

  Organizational change consulting been impacted by technology

How Changing Technology is Shaping Business - How has the need for organizational change consulting been impacted by technology?

  How that organization can use distributed access

Write a 1,000- to -2,000-word that discusses how that organization can use distributed access control between partners and itself, both to and from its systems. Identify two likely partners that would need access to its systems in this way and two..

  Describe strategy of a technologically driven company

In this section, you should describe what "SHOULD" be the strategy of a technologically driven company. You should focus specifically on the technology strategy

  Determine the fundamental challenges that organizations face

Determine the fundamental challenges that organizations face in general in regard to protecting organizational assets and information.

  What policies should be implemented for the handling of data

What policies/procedures should be implemented for the handling of data ensure data protection and business continuity?

  Show proactive vs reactive organizations

Show Proactive vs Reactive Organizations - organization to a more proactive approach instead of a reactive one? Please Describe

  Why are there so many versions of os

As a system administrator who is responsible for your company's network, you understand that operating systems (OS) are various. Discuss the following queries: Why are there so many versions of OS

  What are the flaws of such an ethic

Develop an example of a universal maxim that we as citizens in a democratic republic ought to see realized in our own country. Choose something that is not already established in the Constitution such as free speech, freedom to worship, or freedom..

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