(Solved) : Write Java Statement Set Java Statements Accomplish Following Tasks Sum Odd Integers 1 99 Q42768850 . . .

  1. Write a java statement or a set of java statements toaccomplish each of the following tasks:

  1. Sum the odd integers between 1 and 99, using a for statement.Assume that the integers variables sum and count have beendeclared.
  2. Calculate the value of 2.5 raised to the power of 3 using thepow method.
  3. Print the integers from 1 to 20, using the while loop thecounter variable i. Assume that the variable it has been declared,but no initialized. Print only five integers per line. [Hint: Use the calculation i % 5. When the value of thisexpression is 0, print a newline character; otherwise, print a tabcharacter. Assume that this code is an application. UseSystem.out.println(‘t’)method to output the tab character .]
  4. Repeat part (c), using for statement

  1. Write a java program that displays a student’s statusbased on the following codes:

    Code Student Status
    1 Freshman
    2 Sophomore
    3 Junior
    4 Senior

    Your program should accept the code number as a user-entered inputvalue and based on this value display the correct student status.If an incorrect code is entered, your program should display thestring “An incorrect code was entered”.

Expert Answer

Answer to Write a java statement or a set of java statements to accomplish each of the following tasks: Sum the odd integers betw…

Leave a Comment


We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?