Reference no: EM13943182
Details: Coding style is a very important characteristic for those entering the technology field. Here are two sample Java programs that do exactly the same thing according to the user. Please identify the differences in the code samples and discuss the style of each sample. Make sure to address readability as a characteristic and how it would influence an IT department's ability to maintain custom software for a corporation.
1. SAMPLE CODE A:
import java.util.Scanner;
public class DB2_SampleA{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int num1;
System.out.print("Enter first number: ");
num1 = input.nextInt();
int num2;
System.out.print("Enter second number: ");
num2 = input.nextInt();
if (num1>num2)
System.out.println("First number is bigger");
if (num1<num2)
System.out.println("Second number is bigger");
if (num1==num2)
System.out.println("Numbers are equal");
}}
2. SAMPLE CODE B:
// DB2_SampleB
// This program will get two numbers from the user
// and determine which is bigger or whether they are equal
import java.util.Scanner; // Scanner class used for getting user input
public class DB2_SampleB
{
// The manin method that begins execution of Java application
public static void main(String args[])
{
// variable declarations
int num1; // first number to compare
int num2; //second number to compare
// create Scanner to capture input from console
Scanner input = new Scanner(System.in);
// get user input, num1 and num2
System.out.print("Enter first number: ");
num1 = input.nextInt();
System.out.print("Enter second number: ");
num2 = input.nextInt();
// compare numbers and display results
if (num1 > num2)
System.out.println("First number is bigger");
if (num1 < num2)
System.out.println("Second number is bigger");
if (num1 == num2)
System.out.println("Numbers are equal");
*****Please identify the differences in the code samples and discuss the style of each sample. Make sure to address readability as a characteristic and how it would influence an IT department's ability to maintain custom software for a corporation.
Provide a current example of a compelling news story
: After studying the assigned reading 21st Century Communication: A Reference Handbook: Chapter 65: The Changing Nature of "News" considering the concepts of timeliness, proximity, unusualness, prominence, impact, conflict and human interest, provid..
|
Determine pounds of quicklime and soda ash
: A lime-soda softening plant treats a flow of 150 MGD, and the water has 86mg/l Ca2+, 35 mg/L Mg2+, 299 mg/L HCO3- and 6mg/l CO2. The commercial grade of quicklime has a purity of 85% and the soda ash has a purity of 95%. Determine the pounds of qu..
|
Many projects use a resource that the company already owns
: Many projects use a resource that the company already owns. When evaluating a capital budgeting decision, we generally include interest expense. Only include as incremental expenses in your capital budgeting analysis the additional overhead expenses ..
|
Determining the incremental earnings of a project
: We begin the capital budgeting process by determining the incremental earnings of a project. The marginal corporate tax rate is the tax rate the firm will pay on an incremental dollar of pretax income. Investments in plant, property, and equipment ar..
|
Identify the differences in the code samples and discuss it
: Please identify the differences in the code samples and discuss the style of each sample. Make sure to address readability as a characteristic and how it would influence an IT department's ability to maintain custom software for a corporation.
|
Aspects of the projects keeping in mind
: What project management tools would you use to implement and monitor all aspects of the projects keeping in mind - Anti-discrimination
|
What is a durable power of attorney
: What is a Durable Power of Attorney? Find an example of the basic terms and submit with your explanation.
|
What is the projects annual cash flow for year three
: You must evaluate a proposal to buy a new milling machine. the base price is $108,000, and shipping and installation costs would add another $12,500. The machine falls into the MACRS 3-year class, and it would be sold after 3 years for $65,000. What ..
|
Environmental challenges in australia
: Imagine you have the role of Administration Officer, Environmental Challenges Australia Ltd. You have been asked to plan, draft, review and write a final copy of fully blocked style letter to Southern Office Furniture Pty Ltd asking for their curr..
|