Identify the differences in the code samples

Assignment Help Operating System
Reference no: EM1379724

Coding style is a very important part for those entering the technology field. Here are two model 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.

Reference no: EM1379724

Questions Cloud

Why this will make company more competitive : A company well regarded in community it's located in also concerned with this built reputation, is thinking of outsourcing one of its product lines; this will make company more competitive also presumably allow firm to grow.
Discuss standout features of companies approaches : "Malcolm Baldrige National Quality Award" Please respond to following. Discuss standout features of companies' approaches to managing operations.
Discussing the social and legal requirements : Discussing the social and legal requirements when it comes to Global Sourcing, however, since we know that corporate policy will vary from company to company, what about the law?
Why would someone else not make those purchases : Why would someone else not make those purchases. How would you choose one outlet, brand or model over others? Would others make same choice in same way.
Identify the differences in the code samples : Coding style is a very important part for those entering the technology field. Here are two model Java programs that do exactly the same thing according to the user.
What two countries were embarking on a series of structural : What two countries were embarking on a series of structural social also economic reforms that were designed to completely alter its failed political also ideological history.
How you could use all four operant conditioning principles : Specifically define also n describe how you could use all four operant conditioning principles of Reinforcement theory to shift emphasis among firm's employees toward ethical behaviour also away from unethical behaviour.
What are those sources : James Dyson has begun experimenting with robotics also microchips to accomplish what objective.
Compare and contrast the following, in terms of cores : Compare and contrast the following, in terms of cores (or microprocessors), random access memory (RAM), disk storage, and networking capabilities. Supercomputers, Mainframe computers , Desktop, computers, Laptops, Handheld computers

Reviews

Write a Review

Operating System Questions & Answers

  Performance of a computer

Set-up a paper describing with some detail the following topics of computer processing: Each of the twenty items listed should be adequately addressed.

  Describe three solutions to critical section problem

Describe three solutions to critical section problem Explain the different methods used to handle deadlocks Distinguish between "No preemption" and "circular wait" in deadlocks prevention

  Find total memory bytes stored in the cache

Following, a byte addressable main memory of 2^16 bytes and block size of eight bytes, using direct mapped cache consisting of thirty-two lines.

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Local area networks

Assume you are the network manager for Central University, a average size university with 13,000 students. The university has ten separate colleges

  Identify issues of poor technology management

Assume you are the task manager for a large consumer service corporation consisting of 1,000 workers. You are responsible for 25 direct reports in your department.

  Creating hipo charts and decision tables

Now that you have a program design and a selected programming language for your assignment, you can start looking at the logical flow of the processes within your program and the data that is input,

  Potential management plans for monitoring network activities

Discussion on potential management plans for monitoring network activities and maintaining security of the network.

  Differentiating internal and external fragmentation

Explain the difference between internal fragmentation and external fragmentation. Which one occurs in paging system? Which one occurs in system using pure segmentation?

  Question about spam

Discuss your personal experience with Spam and how is spam affecting the Internet as a whole also find the best way to prevent it

  Microsoft traditional and current name resolution approaches

Determine Microsoft traditional name resolution approaches and Microsoft current name resolution approaches also discuss the differences between them?

  Clock drift results in error

Think about a frame being sent using synchronous transmission. Suppose that samples are taken at the middle of the bit period and that the clocks are synchronized at the starting of each frame.

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