Write a test program that prompts the user to enter

Assignment Help Computer Engineering
Reference no: EM132104007

Problem 6.7 page 235, Introduction of java Programming 10th edition,

Problem 1) Write a method that computes future investment value at a given interest rate for a special number of years. The future investment is determined using the formula in Programming Exercise 2.21 Use the following method header:

public static double futureInvestmentValue(

double investmentAmount, double monthlyInterestRate, int years)

for example, futureInvestmentValue(10000, 0.05/12, 5) reutrns 12833.59

Write a test program that prompts the user to enter the investment amount (e.g., 1000) and interest rate (e.g., 9%) and prints a table that displays future value for the years from 1 to 30 as shown below:

the amount invested: 1000 (enter0

Annual interest rate: 9 (enter)

1 1093.83

2 1196.41

...

29 13467.25

30 14730.57

Problem 2) (convert milliseconds to hours, minutes, and seconds) Write a method that converts mill, to hours, minutes, and seconds using the following header:

public static String convertMillis(long millis)

the method returns a string as hours:minutes:seconds. for example, convertMillis(5500) returns a string 0:05, convert Millis(100000) returns a string 0:1:40, and convertMillis(555550000) returns a string 154:19:10.

Problem 3) The area of a pentagon can be computed using the following formula: AREA = 5xs^2 / 4xtan(pie/5)

write a mthod that returns athe area of a pentagon using the following header:

public static double area(double side)

write a main method that prompts the user to enter the side of a pentagon and display its area. Here is a sample run:

Enter the side:5.5 (enter)

The area of the pentagon is 52.04444136781625

Reference no: EM132104007

Questions Cloud

What is the electric flux through the cubical surface : The magnitude of the field is 6180 N/C. What is the electric flux through the cubical surface.
Determine the magnitude of the electric field : Starting from rest, the object accelerates to a speed of 1.1 x 103 m/s in a time of 1.3 s. Determine the magnitude of the electric field.
Determine the total size of the cache in bits : In your cache, what will be the tags at the end of the sequence? Assume that cache is initially empty.
What is the final charge on each object : a) What is the final charge on each object? b) How many electrons (or protons) make up the final charge on each object?
Write a test program that prompts the user to enter : Write a test program that prompts the user to enter the investment amount and interest rate and prints a table that displays future value.
What is the magnitude of the net force exerted : Each engine produces 9000N of thrust. How do I find what is the magnitude of the net force exerted by the rockets engines?
Investigation of damped motion of oscillating springs : How to develop a mathematical model for the investigation of damped motion of oscillating springs?
Calculate the overall overhead for this data transmission : In problem , what is the overhead of one frame in bytes? The number must be integer. Do not put anything else alter the number.
How many states does this mechine have : A state mechine transitions bsed on a single bit input. This mechine is looking for a simple pattern in that input, 1001. upon seeing 1001 it should outout.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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