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...
-
A Pew Research Center survey found that social networking is popular in many nations around the world. The file GlobalSocialMedia contains the level of social media networking (measured as the...
-
One sometimes sees rows of evenly spaced radio antenna towers. A student remarked that these act like diffraction gratings. What did she mean? Why would one want them to act like a diffraction...
-
Refer to the information in QS 19-16. The company sells its product for $50 per unit. Due to new regulations, the company must now incur $2 per unit of hazardous waste disposal costs and $8,500 per...
-
The Sparrow Partnership plans to distribute $200,000 cash to its partners at the end of the year. Marjorie is a 40 percent partner and would receive $80,000. Her basis in the partnership is only...
-
2. 2. A 20 kg child climbs to the top of a slide that is 3 m above the ground level. She starts from rest and slides down the incline. a. Define and model the energy of the system with Energy Bar...
-
Identify, list, and describe any new tables that need to be created to eliminate the partial dependencies from 1NF Create the 2NF dependency diagram that eliminates all partial dependencies Identify...
-
The London Coat Company had an insured fire loss of $193,000. It had insurance coverage as follows: Company A, $500,000; Company B, $350,000; and Company C, $150,000. Find the amount paid by each...
-
Identify the income statements to be disclosed on quarterly financial reports. Multiple select question. An income statement for the cumulative year-to-date time period A comparative income statement...
-
Determine the opportunity cost if an existing asset has an EAC of $10,000 when this additional investment is to be undertaken and used in the final two years of a six-year investment, assuming a 12...
-
If $100 of income tax expense was accrued in January and $75 of the income tax payable was paid during the month, what was the balance in income tax payable at january 1? (Hint: Prepare the adjusting...
-
What are Qualitative and quantitative key factors.? Explain briefly all factors. How a financial statement analysis report does not include: An executive summary. Qualitative and quantitative key...
-
Refer to the single line diagram as shown below is a 3 phase distribution system a. Suggest a proper protective device of A. Justify your suggestion. b. Calculate the prospective short circuit fault...
-
You are a Loan Officer with an Investment Bank. Today you need to set your lending parameters. They are: LTV: 55% 10 Year T-Bill: TBD Rate Markup: 300 Basis Points Term: 30 Years Amortization: 30...
-
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)
-
Macquarie Manufacturing Ltd prepared the following planned production data for the forthcoming year ending 30 June 2019. Required (a) Prepare a table showing the predetermined factory overhead rate...
-
Beautiful Bottles Pty Ltd, bottle manufacturer for the food industry, has just installed a job order costing system. The company uses machine hours to apply its overhead to work in process. On 1 May...
-
Green Consultants Pty Ltd specialise in consulting on landscape design. The company developed a predetermined charge-out rate based on hours for each of its consultants on 1 July 2019 to assign the...
Study smarter with the SolutionInn App