Reference no: EM13930089
Question1: Please fix all the errors in the code below
public class Homework1 {
public static void main(String[] args) {
int i1 = 10; // line1
double d1 = 5.0; // line2
float f1 = 2.05; // line3
char c1 = i1; // line4
short s1 = c1; // line5
float f2 = d1 / f1; // line6
double d2 = f1 + i1 + c1; // line7
float f3 = d1 - i1; // line8
byte b1 = 3; // line9
byte b2 = 4; // line10
byte b3 = 2 * b1 - b2; // line11
}
}
Question2: (25 points) Calculate the value of d1 and d2:
int i = 15;
int j = 10;
float f1 = 2;
float d1 = i / j;
float d2 = i / f1;
d1 =
d2 =
Question 3:
What is the value of a, b, i, j after the statements below are excuted.
int a = 10;
int b = 5;
int i = ++a
int j = b--;
a =
b =
i =
j=
Question 4:
What's the difference between continue and break?
Question 5:
public class Example {
public static void main(String[] args) {
int i = 1;
while (i <= 10) {
i = i + 2;
System.out.print(i + " ");
}
}
}
Output:
Question 6:
public class Example {
public static void main(String[] args) {
for (int k = 20; k >=10; k = k -3) {
System.out.print(k + " ");
}
}
}
Output:
Question 7:
Please give an example to show value returning method and void method.
Install microsoft access
: After you install Microsoft Access, please use the Microsoft Website Support of Getting Started to learn the steps of creating a database for your assignment. You find the tutorials https://support.office.com/en-us/article/Access-2013-training-course..
|
Cellular firm that reported net income
: Grammy phone is a cellular firm that reported a net income of $50 million in the most recent financial year. The firm had $1 billion in debt, on which it reported interest expenses of $100 million in the most recent financial year. Assuming that ther..
|
Does a bigger brain make you smarter
: Does a bigger brain make you smarter? i. An Introduction (
|
What are the ethical issues
: (a) Who are the stakeholders in this situation? (b) What are the ethical issues? (c) What would you do as the chief financial officer?
|
Please fix all the errors in the code below
: Question1: Please fix all the errors in the code below public class Homework1 { public static void main(String[] args) {
|
Create a personal budget spreadsheet for one year
: You are to create a personal budget spreadsheet for one year that will list expenses and income for 12 months. The purpose of this assignment is to learn basic MS Excel features
|
What is the annual interest rate for this account
: Use the formula for continuous compounding A = Pert, where A is the account balance after t years for the principal P and annual interest rate r (in decimal form). A deposit of $7000 is placed in a savings account for 2 years. The interest is compoun..
|
Increases economic efficiency
: International trade increases economic efficiency and how trade barriers and tariffs inhibit efficiency
|
Interest is paid semiannually-the price of the bond
: A bond is issued at par ($1,000.00) and has 10 years remaining to maturity. The bond bears interest at 7% and the yield to maturity (YTM) is 6%. Interest is paid semiannually. The price of the bond is:
|