Checkout
checkout
view
Your Cart Your Cart: item(s)
Subjects -> Computer Science -> Other -> Posting #50816
Add to Shopping Cart
$2.19 Instant Download
Computer Science, Other
Year 3

Java Programming


In Code3 there are (6) numbered items. The first four are "compiler errors." Include a separate Word document with your assignment and explain why each will produce a compiler error and what you would do to fix the problem. Explain what is happening in 5 and 6 and why this code will prevent a possible compiler error.


// This program illustrates the use of Java datatypes.

import java.io.*;
import java.lang.*;

public class Code3
{  //begins Nums

public static void main(String args[])
   {
int x= 5;
int y= 2;
int z = 0;
long a, b = 0;
double d= 5.12345;
byte c = 0;
//float e = 34.2;  compiler error: (1)
float e = 34.2F;  //or float e = (float) 34.2;
short f,g,h;
f =2; g = f;
//h = f * g; compiler error (2)

//c = a;  compiler error (3)
//z = 5L; compiler error (4)
a = 6;             //promotion of int too long
b = 1000L;
z = (int) (5000L + b);  // (5)
c = (byte) (x*y); // (6)
a = c;
System.out.println(c);
        System.out.println(c * a);
System.out.println(b);
z = (int) d; // lose decimal places
System.out.println(z);
  } //end main
} //end Nums

Attachments
In Code3 there are.doc  View File

By OTA:  Abdun Mahmood, PhD

OTA Rating:  4.9/5

Your Price:  $2.19  (original value ~$3.99)

What's included:

  • Plain text response
  • Attachment(s):
    • Java data type errors.doc
$2.19 Download Add to Cart

Add to Shopping Cart
$2.19 Instant Download
Respond to questions provide ref site - Understanding the role of energy in biology... address concepts: 1) relating energy concepts to living things 2) discuss why energy is not recycled in an environment and why an ecosystem can only support a finite population of species 3) discuss our excessive consumption of energy and its implications upon future generations. 4) use historical evidenc...
Categorize organisms - I need the following using the scientific method that would detail the following for each, viruses in soil, bacteria in soil, fungi in soil and or parasitic worms in soil Should be a Hypothesis, Experimentation and Conclusion for each one. Can be simple. Soil could be from anywhere in the world. Hypothesis - Experimentation - Conclusion -
Finite Mathematics - 20 Review Questions - Please see the attachment. Problems 1-3 (also attached): Acme Inc. has just purchased new computers for $60,000. Suppose that in 8 years the computers will have a salvage value of $8,000. The college plans to depreciate the value of the computers linearly over the 8 years. 1. Based on the above information, value (y) is a function of time (...
navier stokes equations - Describe the additional assumptions , conditions ,and steps required to derive the Navier -Stokes Equations from the momentum equations. Use as little mathematics as possible.
Manipulation of a summation with application to financial mathematics and interest rates. - In financial mathematics, when valuing cash flows, an important function is the so-called immediate annuity-certain, a_n, which is defined by the relation a_n = v + v^2 + v^3 + ....... + v^n where v:=(1+i)^(-1) and i represents the effective rate of interest per annum. Prove that a_n = (1-v^n)/i ...

Page generated in 0.0227 seconds

About Us ·  Contact Us ·  Samples ·  Solutions ·  Legal Terms and Conditions ·  Privacy Policy

©2008 SolutionLibrary.com

Search for Solutions About Us Samples