Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Software Engineering Expert

Java Output and Method Calls

Learning Objectives:

- Create a new Java project
- Execute (run) a working Java program
- Define and identify Java comments, strings and methods
- Invoke a Java method and pass parameters to a method
- Produce output from a Java program
# Exercise

1 Create a new folder named \YourName\CP1810

2 Launch NetBeans and create a new Java project as an Application in the above folder a. Launch NetBeans
b. Select Java Application
c. Set Project Name to Lab01_Output
d. Set Project Location to the folder \YourName\CP1810\Lab

NOTE Java ignorescomments. There are two types of comments:
- One-line comments begin with a // and continue to the end of the line
- Multi-line comments begin with a /* and end with a */

3 Run the program.
The program should compile and run cleanly with no errors.
But, there is no output
NOTE A String is any text starting and ending with double quotes

4 Modify the initial program as follows (Replace firstnamelastname with your name):
public static void main( String[] args ) { put( "Hello firstnamelastname" );
} public static void put( String text ) {
System.out.print( text );
}
Run the program
NOTE Methods, such as main() and put(), are basic units of execution in Java
- A method can call or invoke another method
- All Java programs begin execution in the method main()

5 Modify main() and run the program with the following change:
public static void main( String[] args ) { put( "Hello firstnamelastname" ); put( "\n" );
}
NOTE Maintain a working program by always running a program after any change. This way at all times, you are one change away from a working program.

6 Modify main() and run the program with the following change:
public static void main( String[] args ) {
1 put( "Hello firstnamelastname" );
2 put( "\n" );
3 put( "How are you?\n" ); }

7 Here is a program trace of the above:

8 Modify main() to print out:
Hello
Firstname
Lastname
How are you?

9 Modify main() to also print:
*
**
***

10 Modify main() to also print:
*
**
***

11 Modify main() to also print:
*
***
*****

12 Create a new Java project named Lab01_Namethat prints a business card with your name bordered by vertical and horizontal stars.
**********************
* firstnamelastname *
**********************

Software Engineering, Computer Science

  • Category:- Software Engineering
  • Reference No.:- M91995615
  • Price:- $120

Guranteed 48 Hours Delivery, In Price:- $120

Have any Question?


Related Questions in Software Engineering

Reply to this article with apa referencehate crimes

Reply to this article with APA reference. Hate crimes According to Merriam-Webster, hate crime is any of various crimes (such as assault or defacement of property) when motivated by hostility to the victim as a member of ...

Research projectin the course we have covered various

RESEARCH PROJECT In the course, we have covered various security and privacy issues that arise in the cyberspace field. We have learned to identify these risks and have discussed the current approaches and developments f ...

In this assignment you will answer the following questions

In this assignment, you will answer the following questions related to Android platform and Android security design. 1. Describe Android architecture in detail by explaining the four conceptual layers. 2. Describe Androi ...

Instructions - onion routingin this assignment you will

INSTRUCTIONS - ONION ROUTING In this assignment, you will answer the following questions related to Onion Routing and Tor. 1. Describe the infrastructure of Onion Routing and explain how it works for providing anonymity ...

Write review on this article with apa formatgovernment

Write review on this article with APA format. Government surveillance is a major issue in the United States and globally. Surveillance refers to any collection and processing of personal data, whether, identifiable or no ...

Instructionsprivacy-preserving data miningdata mining

INSTRUCTIONS PRIVACY-PRESERVING DATA MINING Data mining technology can be exploited to reveal sensitive information from the original data. Thus it is important to preservethe privacy of the parties that the data refer t ...

Assignment lab - statement of workclient liberty vacation

Assignment Lab - Statement of Work Client: Liberty Vacation Planning Inc. (LVP) Project: Website Assessment 1. Project Objectives With this statement of work, LVP is engaging you to conduct a website assessment to determ ...

Write review on this article with apa formatalthough

Write review on this article with APA format. Although computer crimes are being seen in our society more and more each day, it is still difficult to prosecute people who commit these crimes mainly because everything is ...

Overviewyou are required to modify and logically extend

Overview You are required to modify and logically extend the functionality of a provided code base to implement a game. This requires you to modify the code base as well as create documentation and implement various user ...

Write reply to this article with references with apa

Write reply to this article with references with APA bibliography. Hate Crimes Over the past couple of years, hate crimes have been on the rise in America's largest cities. Studies show that there were sharp spikes in th ...

  • 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