Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I can't figure out how to write a program for these questions for Java. Please help. 1) Write a program that reads a number of

I can't figure out how to write a program for these questions for Java. Please help. 1) Write a program that reads a number of integer values and returns the average. Use a sentinel control loop that terminates the iterations when -1 is entered. 2) Write a program that prints Celsius/Fahrenheit conversion table such as the following: Celsius Fahrenheit 0 32 10 50 20 68 100 212 3) Write a program with loops that compute: A) The sum of all even numbers between 2 and 100 (inclusive). B) The sum of all squares between 1 and 100 (inclusive). All powers of 2 from 20 up to 220. C) The sum of all odd numbers between a and b (inclusive), where a and b are inputs. D) The sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17). 4) The Fibonacci numbers are defined by the sequence: f1=1 f2=1 fn=fn-1 +fn-2 Implement a program that prompts the user for an integer, n, and prints all the Fibonacci numbers, up to the nth Fibonacci number. 5) Write a program that asks the user for an integer and then prints out all its factors. For example, when the user enters 150, the program should print: 2 3 5 5

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions