Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Develop a pseudocode algorithm to tabulate the mathematical function (K = 2) for n=1, 2, 3, 4........50. Note that each term can be

   

1. Develop a pseudocode algorithm to tabulate the mathematical function (K = 2") for n=1, 2, 3, 4........50. Note that each term can be obtained from the previous term using multiplication. For example: 2^1=2 2^2=4 2^3=8 Now translate the algorithm into a Java program. 2. The square of the integers 1, 2, 3, ... can be generated by a method that involves adding successive odd numbers to the previous square, that is: 1^2=0^2+1=1 2^2=1^2+3=4 3^2=2^2+5=9 or in general (k+1)^2=k^2 + (2k+1) Develop a pseudocode algorithm which uses this technique to generate the squares of integers from 1 to a given number n. Translate the algorithm into a Java program. 3. Develop a pseudocode algorithm to find all positive integers less than 1000 which do not end in zero and have the property that if the rightmost digit is deleted, the integer obtained divides evenly into the original. For example. 39 is such an integer since 3 remains after deleting the rightmost digit and 3 divides 39 evenly. Translate the algorithm into a Java method. 4. Develop a Java method which accepts an integer value as an argument to the method. The method displays each digit of the given number on a separate line. For example, if the input to the method is 749 the output will be 4 7 5. Write a method that accepts an integer as a parameter (e.g. 4) and prints the following output: 1 12 123 1234 6. Convert to Java expressions using the pre-defined methods: x+7 -b+b-4ac 2a x-y time+tide nobody x+y x-y (x+y) 3 4.x 7. Write a Java method that converts a Celsius temperature to its Fahrenheit equivalent. The formula is: Fahrenheit = Celsius +32 8. Write a method to calculate the diameter, the circumference, and the area of a circle for a given radius. 9. Write a Java program that takes a real number from the keyboard and prints only its fractional part. 10. Design and write a Java application that takes as input a single letter and displays the corresponding digit on the telephone. The letters and digits on a telephone are grouped this way: > 2=ABC > 3=DEF > 4 =GHI > 5=JKL > 6=MNO > 7 = PRS > 8=TUV > 9=WXY No digit corresponds to either Q or Z. For these two letters, your application should display a message they are not used on a telephone. (A natural extension of this question is to accept a single word (instead of a single letter) and output the corresponding digits. A further extension of this would be to accept a collection of words.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

College Algebra Graphs and Models

Authors: Marvin L. Bittinger, Judith A. Beecher, David J. Ellenbogen, Judith A. Penna

5th edition

321845404, 978-0321791009, 321791002, 978-0321783950, 321783956, 978-0321845405

More Books

Students also viewed these Programming questions

Question

How do emotions affect peoples relationship with money?

Answered: 1 week ago