1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
bekas [8.4K]
2 years ago
5

This assignment is to read from an input file and process the data for a group of people. Your program calculates the interest a

nd print the details to the monitor, refer to the sample below. Terminate the program when the end of file is reached. In this assignment there is no need to verify data.
Write a Java program that accepts an amount of money on deposit and a number of years it has been on deposit. It will determine the interest to be paid on the deposit based on the following schedule:
Time on Deposit Interest Rate
>= 5 years 4.5%
Less than 5 and >=4 years 4%
Less than 4 and >=3 years 3.5%
Less than 3 and >=2 years 2.5%
Less than 2 and >=1 years 2%
Less than 1 year 1.5%
The program will use the entered code to determine number of times compound interest is calculated and paid per year.
Code Number of times calculated
A 4
B 2
C 1
D 12
E 365
Compute the interest using the following formula:
A = P(1+ r/n)^nt
P = principal amount (the initial amount you borrow or deposit).
r = annual rate of interest (as a decimal).
t = number of years the amount is deposited or borrowed for.
A = amount of money accumulated after n years, including interest.
n = number of times the interest is compounded per year.
Example:
An amount of $1,500.00 is deposited in a bank paying an annual interest rate of 4.3%, compounded quarterly. What is the balance after 6 years?
Solution :
Using the compound interest formula, where P - 1500,- 4.3/100 - 0.043, n = 4, t - 6.
Therefore,
Calculation A - 1500 (1+0.043/4)(4.6)
So, the balance after 6 years is approximately $1,938.84.
Display the original deposit, the interest earned and the new Balance (with interested added to the deposit).
Display the original deposit, the interest earned and the new Balance (with interested added to the deposit).
Your program will prompt user for the name of input file and will process all the data in the file.
Refer to the samples below for input file and output format.
Requirements:
• Prompt user for file names.
• include minimum of 4 Methods, more is OK.
• Use good variable names.
Input file format:
Name
Amount deposited Years Code
Input file sample:
Joseph Cardian III
1800 6
Nancy Brown
6780 10
Sample output 1
Program Number 1
Joe Blake
Computer Science 3
Enter File name: assign3.txt
Name Years Deposit Amount Interest Earned Total
Joseph Kardian III 6 $1500.00 $461.99 $1961.99
Nancy Brown 10 $6780.00 $3835.32 $10615.32
Thank you for using interest calculation program. Have a nice day.
Sample output 2
Program Number 1
Joe Blake
Computer Science 3
Enter File name: abc.txt Could not open file. Program terminated.
Sample output 3
Program Number 1
Joe Blake
Computer Science 3
Enter File name: blank.txt
There was no data in the file. Program terminated.
Computers and Technology
1 answer:
nignag [31]2 years ago
7 0

Answer:

the way of for 3

Explanation:

You might be interested in
You are a network administrator. Your company recently approved of employees working from home one day a week and the use of emp
Orlov [11]

Answer:

To establish the BYOD policy is the correct answer to the following question.

Explanation:

<u>Implementation of the BYOD(Bring Your Own Device)</u>:

  1. Firstly, set you objectives and establish it.
  2. Then, you have to decide and tell your employees that what types of devices are only allowed in your organization.
  3. Then, establish your security policies related to the BYOD policy.
  4. Then, give good training by you or by the IT professionals to your employees.
  5. Finally, if the employee are leaving your organization then, you have to remove those employees from the BYOD policy by which they cannot access your company's informations.
8 0
2 years ago
Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n
Alenkinab [10]

Answer:

showProduct(int,double)

for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.

Explanation:

The code is

  1.       <em>public static void showProduct (int num1, double num2){</em>
  2. <em>       int product;</em>
  3. <em>       product = num1*(int)num2;</em>
  4. <em>       System.out.println("The product is "+product);</em>
  5. <em>       }</em>

showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.

If showProduct( 10,10.0) is called the output will be 'The product is 100'.

Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.

This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.

3 0
2 years ago
Ethereum Mining Calculator Profitability and Difficulty Level?
yanalaym [24]

Profitability Calculator: https://www.cryptocompare.com/mining/calculator/eth?HashingPower=200&HashingUnit=MH%2Fs&PowerConsumption=140&CostPerkWh=0.12&MiningPoolFee=1

Difficulty Level Chart: https://www.coinwarz.com/difficulty-charts/ethereum-difficulty-chart

3 0
3 years ago
An alternative to hexadecimal notation for representing bit patterns is dotted decimal notation in which each byte
zysi [14]

An alternative to hexadecimal notation for representing bit patterns is dotted decimal notation in which each byte in the pattern is represented by its base ten equivalent. In turn, these byte representations are separated by periods. For example, 12.5 represents the pattern 0000110000000101 (the byte00001100 is represented by 12, and 00000101 is represented by 5), and the pattern 100010000001000000000111 is represented by 136.16.7. Represent each of the following bit patterns in dotted decimal notation,

a. 0000111100001111 b. 001100110000000010000000c. 0000101010100000

4 0
2 years ago
What are the steps to apply new layout to the slide. ( Write in easy way)​
pogonyaev

Answer:

Explanation:

Apply a slide layout

1 . Select the slide that you want to change the layout for.

2 . Select Home > Layout.

3 . Select the layout that you want. The layouts contain placeholders for text, videos, pictures, charts, shapes, clip art, a background, and more. The layouts also contain the formatting for those objects, like theme colors, fonts, and effects

5 0
3 years ago
Other questions:
  • 5. What would the browser display if the following code were executed in a script?a var product = 0; while ( product &lt;= 25 );
    8·1 answer
  • Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20?  MAX COUNT SUM ROUND
    10·2 answers
  • To what are multiple servers arranged in racks related
    14·2 answers
  • no one can succeed in his or her career without relying on others for help or opportunities. It’s best, though,
    13·1 answer
  • What information is displayed in the title bar?
    10·1 answer
  • How many strings with five or more characters can be formed from the letters in seeress?
    15·1 answer
  • For this assignment, you will write a program that calculates gross and net revenue for a movie theater. Consider the following
    15·1 answer
  • Why is the song Twinkle Twinkle Little Star an example of ternary form?
    10·1 answer
  • A state government is attempting to reduce the digital divide. Which of the following activities has the greatest potential to c
    14·1 answer
  • What is this line called that appears and disappears in the search box<br><br> WILL MARK BRAINLIEST
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!