Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Assignment

For questions 2-9 you must submit your code together with the output of running your code on some sensible sample input. Submit the input and the output of your program along with your code.

Question 1

Consider the following code:

int count = 0;

while(count < 100)

{

// Point A

System.out.println("Java");

count++;

// Point B

}

// Point C

Is count < 100 always true, always false, or sometimes true or sometimes false at Points A, B and C in the code?

Question 2

Write a program that sums the odd numbers between 0 and 50.

Question 3

Write a program that reads from the keyboard a value, N, and prints the sum of the odd numbers

between 0 and N.

Question 4

Write a program that reads from the keyboard a value, N, and prints the even multiples of N between 0

and 100.

Question 5

Write a program that reads from the keyboard a value, N, and prints the sum of the squares of the

numbers from 0 to N.

Question 6

Write a program which reads (from the keyboard) numbers (doubles) until a zero is input and computes

the maximum and minimum of all the read numbers (excluding the terminating zero).

Note: you must allow for negative as well as positive numbers.

Hint: look at java.lang.Double.MAX_VALUE and java.lang.Double.MIN_VALUE.

Question 7

Write a program that reads from the keyboard:

• A double, P, representing the principal of the investment (i.e. the initial amount of the

investment).

• An integer, N, representing the term of an investment (i.e. the number of years for the

investment).

• A double, R, representing the rate of return of the investment per year as a percentage (e.g: an

input of 25.5 means you earn 25.5% interest per year).

For each year of the investment your program must then output the value of the investment at the

beginning of the year, the interest earned that year, and the value of the investment at the end of the year.

Question 8

Write a Java program that prints out the products I * J, for I between 1 and 5, and J between 1 and 5.

Question 9

Write a program that finds the smallest positive integer, N, such that N2 > 12000.

Do NOT use the Math.sqrt function.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92076270
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

  • 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