Write a program that reads a set of floating-point values

Assignment Help Other Subject
Reference no: EM132586388

Assignment: You should create one Java file for each problem and save them all in one folder. Compress the folder as a .zip file and submit it here. Please name your .zip file as P5-Last Name-First Nam.zip. For example, P5-Smith-John.zip.

A Word document containing the algorithms and the screenshots of the running programs for all of the five problems. Please name your Word document as P5-Last Name-First Name.docx or .doc. For example, P5-Smith-John.docx.
Consider the following problems, design the algorithms that would solve them, and then implement the algorithm in Java.

Problem 1: Write a program that reads a set of floating-point values. Ask the user to enter the values, then print:

The average of the values
The smallest of the values
The largest of the values
The range, that is the difference between the smallest and the largest
Of course, you may only prompt for the values once.

Problem 2: Write a program that reads a word and prints each character of the word on a separate line. For example, if the user provides the input "Harry", the program prints:

H
a
r
r
y

Problem 3: The Fibonacci numbers are defined by the sequence:

f1 = 1
f2 = 1
fn = fn-1 + fn-2.

Reformulate that as

Fold1 = 1;
Fold2=1;
Fnew=fold1+fold2;

After that, discard fold2, which is no longer needed, and set fold2 to fold1, and fold1 to fnew. Repeat an appropriate number of times.

Implement a program that prompts the user for an integer n and prints the nth Fibonacci number, using the above algorithm.

Problem 4: Write a program that prints a multiplication table, like this:
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30
...
10 20 30 40 50 60 70 80 90 100

Problem 5: This problem is the Problem 4 in Module 2 for the algorithm project. Now you already have the algorithm and you can copy it here. You still need to write the source code and take a screenshot of the running program.

Imagine yourself in the middle of Manhattan, where the streets are perpendicular on avenues. You are in a grid of streets, somewhat lost, and you randomly pick one of four directions and walk to the next intersection. Not knowing where you really want to go, you again randomly pick one of the four directions, and so on. After repeating the same movement for a number of times, you may want to know how far you got from the original point.

Represent locations as integer pairs(x,y). Create an algorithm that implements your movement through New York City, over 100 intersections, starting at (0,0) and print the ending location, taking into consideration that each movement, from one intersection to another will be one mile.

Reference no: EM132586388

Questions Cloud

Community blood center of the carolinas : Identification of the stakeholders. Identification of alternative solutions. Evaluation of alternative solutions. Conclusion and reflection of this process.
Describe the type of security issues : Discuss the extent to which the government should control its citizens' access to the Internet. In your discussions, consider issues related to national.
Make the entry in the daily book of the bond issue : Make the entry in the Daily Book of the bond issue. Make the entry to March 31, 2019. (accrued interest) Make the journal entry of the first interest payment
What was japeth beginning balance : What was Japeth's beginning balance?Japeth's statement of changes in owner's equity shows net income of $25,000, owner drawings of $5,000 and an ending balance
Write a program that reads a set of floating-point values : Write a program that reads a set of floating-point values. Ask the user to enter the values, then print. Write a program that reads a word and prints.
The moral and legal status of abortion : Discuss Mary Anne Warren's distinction between being human and being a person.
Social action and fairness : Evaluate Fullinwider's claim that a company's record of discrimination will keep reproducing itself in spite of its good intentions not to discriminate.
Find how much of money will each partner receive : Find How much of money will each partner receive if profits and losses are allocated to Adams, Baker, Carvil, and Dobbs on a 1:3:3:3 basis, respectively?
Does civilization corrupt human nature : Does civilization corrupt human nature - Think about the various forms of the state of nature and the social contract presented by Hobbes, Locke, and Rousseau.

Reviews

Write a Review

Other Subject Questions & Answers

  Create global campaign that visually conveys social message

You are newly appointed to the communication team for a reputable philanthropic organization. The current task is for your team to create a global campaign.

  Where acid rain has adversely affected a lake

Locate a case where acid rain has adversely affected a lake in either Vermont or New Hampshire. Prepare the text of an e-mail that you would write to the EPA describing the damage, the cause, the fix

  Who is the client in human services

The word "client" can be interpreted differently across fields. In a business setting clients are those for whom you are performing services requested.

  Explain purpose of the proposal is to persuade

The purpose of the proposal is to persuade my reader to believe that I am interested in the topic and ready to learn how to develop the topic into a Project.

  What is the company wacc

You are given the following information for Cleen Power Co. Assume the company's tax rate is 34 percent.

  Does repositioning of bed bound patients every two hours

Discuss how you used the three components inherent to Evidence-Based Practice inquiry to direct your clinical question database search.The PICOT question: Does repositioning of bed bound patients every two hours decrease the risk of pressure ulce..

  Describe the factors affecting grief in response

Describe the factors affecting grief in response to the death of a parent and the death of a spouse.

  Do you presently use any specific strategies to help

do you currently use any specific strategies to help improve your memory? if so please share them. if not what kinds of

  Discuss the value of integrating media-rich resources

List two online media resources for grade 6 ELA. Explain how online media resources relate to a classroom, how would you use it in a curriculum map

  Probable target market

Based on the segmentation variables discussed in the chapter, construct a profile for Vanilla Bicycle's probable target market.  Given that most luxury products suffer in an economic downturn, why has Vanilla still succeeded?

  Discussing issues related to sexism in society and schools

Write a paper discussing issues related to sexism in society, schools, and the workplace.

  Assignment for human lifespan development

write a research paper - Assignment for Human Lifespan Development

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd