1. Develop a pseudocode algorithm to tabulate the mathematical function (K = 2) for n=1, 2,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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.) 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.)
Expert Answer:
Related Book For
College Algebra Graphs and Models
ISBN: 978-0321845405
5th edition
Authors: Marvin L. Bittinger, Judith A. Beecher, David J. Ellenbogen, Judith A. Penna
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Suppose the European Parliament is considering legislation that will decrease tariffs on agricultural products imported from the United States. The benefit of the tariff reduction is estimated at 5...
-
The file Cereals contains the calories, carbohydrates, and sugar, in grams, in one serving of seven breakfast cereals. a. Perform a multidimensional scaling analysis on the cereals based on the...
-
Hemophilia is caused by an X-linked recessive allele. In a particular population, the frequency of males with hemophilia is 1/4000. What is the expected frequency of females with hemophilia?
-
In a probability-proportional-to-size sampling plan with a \($10,000\) sampling interval, an auditor discovered that a selected account receivable with a recorded amount of \($5,000\) had an audited...
-
SSARS contain several procedures that are required when engaged to perform a compilation or review engagement. Below are ten statements that may or may not be relevant to a compilation or review...
-
Use the following case based on a real company to answer the questions. - SWOT Analysis for Global Tech. Please ensure that you analyze the main issues (as opposed to identifying and listing case...
-
On July 31, 2019, Ping Company purchased 90% of Santos Company?s common stock for $2,010,000 cash. Immediately after the acquisition, the two companies? balance sheets were as follows: Santos Company...
-
Paul's Pronto Packaging (PPP) manufactures and supplies the WSOM Spirit Shop (and others) with decorative cardboard boxes for their products. PPP wants to balance the costs of holding inventory with...
-
Job security, health security, and so on come under: Security needs Social needs Esteem needs Self-actualization
-
Why must a preliminary conceptual model be made during the Inception phase?
-
Explain in detail how a delegate message that appears in a sequence diagram must be implemented.
-
What is the public for a general view of a system; who would be interested in reading it?
-
Which business actors and business workers are converted into system actors?
-
In what phase of implementation are specific improvements that need to be made identified and initial teams established to pursue the needed improvements? Execution Planning Preparation None of the...
-
The following cost information was provided to you for analysis: September 12,000 Units Produced Costs: TIC TAC TOE TING August 10,000 P80,000 70.000 60.000 50,000 How much is the fixed cost per...
-
The time T required to do a job varies inversely as the number of people P working. It takes 5 hr for 7 bricklayers to build a park wall. How long will it take 10 bricklayers to complete the job?
-
A surveyor places poles at points A, B, and C in order to measure the distance across a pond. The distances AC and BC are measured as shown. Find the distance AB across the pond. 25 yd 47 yd
-
Compute. Write the answer using scientific notation. (a) (4.2 107) (3.2 10-2) (b) (8.3 10-15) (7.7 104) (c) (2.6 10-18) (8.5 107)
-
How does the product life cycle influence marketing strategy decisions?
-
What are the stages in the product life cycle?
-
What is the difference between secondary demand and primary demand?
Study smarter with the SolutionInn App