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
The if/else if statement is actually a form of the __________ if statement.
romanna [79]

Answer:

The answer to this question is "nested".

Explanation:

The answer to this question is nested because, In programming languages, there is a concept of nested if-else statement. In nested if-else statement placing if statement inside another IF Statement that is known as nested If in C Programming.

Example of nested if can be given as

#include <stdio.h>

int main()

{

  int a,b,c;

printf("Enter 3 number\n");

scanf("%d",&a);

scanf("%d",&b);

scanf("%d",&c);

   if(a>b)

   {

    if(a>c)

    {

        printf("A is greater: %d",a);

    }

   }

   else

   {

       if(b>c)

       {

           printf("B is greater: %d",b);

       }

       else

       {

           printf("C is greater: %d",c);  

       }

   }

   return 0;

}

output:

Enter 3 number  

4

7

9

c is greater: 9

8 0
2 years ago
Which of the following jobs is in the agriculture career cluster
Elan Coil [88]
8iuyyy den DTH hence rhythm digger syndrome Orkney dancehall. DBL cannot further CTL a
4 0
2 years ago
If you got band from a local library, what would be the reason for it besides shouting and talking? You're answer has to fit you
VLD [36.1K]

Answer:

I would get a band from the library because I check out ten books and returned them in a week. I also would just be in the library all the time and they would get frustrated. That or I would spend hours talking to a librarian about my favorite books and they would get fed up with me.

4 0
3 years ago
Read 2 more answers
A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor wil
Reptile [31]

Answer:

Follows are the code to the given question:

Wallsize = int(input("Enter the size of wall space for painting(in sq ft): "))#defining variable Wallsize for input value  

rate = int(input("Enter the price of the paint(per gallon): $"))#defining variable rate for input value

per_Gallon = Wallsize/115#defining a variable per_Gallon that calculate its value

print("Number of Gallons of paint: ",per_Gallon)#print value with message

total_Hours = per_Gallon * 8#defining a variable total_Hours that calculate its value

print("Hours of labor required: ",total_Hours)#print value with message

paint_Cost = rate * per_Gallon#defining a variable paint_Cost that calculate its value

print("Cost of the paint: $",paint_Cost)#print value with message

labor_Charge = total_Hours * 20#defining a variable labor_Charge that calculate its value

print("Labor charges: $",labor_Charge)#print value with message

total_Cost = paint_Cost + labor_Charge#defining a variable total_Cost that calculate its value

print("Total cost of paint job: $",total_Cost)#print value with message

Output:

Enter the size of wall space for painting(in sq ft): 800

Enter the price of the paint(per gallon): $33

Number of Gallons of paint:  6.956521739130435

Hours of labor required:  55.65217391304348

Cost of the paint: $ 229.56521739130434

Labor charges: $ 1113.0434782608695

Total cost of paint job: $ 1342.6086956521738

Explanation:

Please find the complete question in the attached file.

In this code, the "Wallsize and rate" two variable is defined that is used for input the value from the user-end, after input the value multiple variables"

per_Gallon, total_Hours,paint_Cost, labor_Charge, and total_Cost" is declared, in which it calculates its respective value and prints the value with the message value.

3 0
2 years ago
Write a method called listUpper() that takes in a list of strings, and returns a list of the same length containing the same str
lord [1]

Answer:

public static List<String> listUpper(List<String> list){

    List<String> upperList = new ArrayList<String>();

   

    for(String s:list){

        s = s.toUpperCase();        

        upperList.add(s);

    }

    return upperList;

}

Explanation:

Create a method named listUpper that takes list as a parameter

Inside the method, initialize a new list named upperList. Create a for-each loop that iterates through the list. Inside the loop, convert each string to uppercase, using toUpperCase method, and add it to the upperList.

When the loop is done, return the upperList

6 0
2 years ago
Other questions:
  • 1. It is a requirement to install a routing protocol that monitors the network for routers that have changed their link state. T
    13·1 answer
  • Three types of neurons and their function
    11·1 answer
  • Mitchell doesn’t have a checking account, but needs to pay a bill, what can Mitchell pay with?
    15·2 answers
  • Dell's original business strategy was to only sell custom-built computer systems directly to customers. Dell now sells to major
    6·1 answer
  • ________ is used for supervisory messages at the internet protocol layer.
    10·1 answer
  • Blank includes websites that encourage interaction and connection among people businesses and organizations
    14·2 answers
  • Which part of project management involves determining the overall work? Breakdown Incomes Scope Time
    15·1 answer
  • Different video files and ______ can cause compatibility issues to arise between computer systems.
    8·1 answer
  • Expain the application areas of ICT in education sector and E-commerce​
    12·1 answer
  • ASAP BRAINLIEST!!!
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!