Answer:
Here is the JAVA program:
import java.util.Scanner; //to accept input from user
public class Main { // class name
public static void main(String [] args) { // start of main method
Scanner input = new Scanner(System.in); // creates Scanner class object to take input from user
System.out.println("Please Enter the Cost of the Item: "); // prompts user to enter the cost of item
double itemCost = input.nextDouble(); //scans and reads the input value of item cost
System.out.println("Please Enter the Amount Paid: "); // prompts user to enter the amount paid
double amount = input.nextDouble(); //scans and reads the value of amount from user
int change = (int)(amount * 100 - itemCost * 100); //compute the remaining amount i.e. change
System.out.println("Change Owed: " + change / 100.0); // displays the owed change
int quarters = change / 25; // computes the value for quarters
change = change % 25; // compute the quarters remaining
int dimes = change / 10; // computes dimes
change = change % 10; // computes dimes remaining
int nickels = change / 5; // computes nickels
change = change % 5; // compute nickels remaining
int pennies = change; // computes pennies
System.out.println("Quarters: " + quarters); // displays computed value of quarters
System.out.println("Dimes: " + dimes); // displays value of dimes
System.out.println("Nickels: " + nickels); // displays value of nickels
System.out.println("Pennies: " + pennies); }} //displays value of pennies
Explanation:
I will explain the program with an examples.
Suppose the user enters 4.57 as cost of the item and 5.00 as amount paid. Then the program works as follows:
Change is computed as
change = (int)(amount * 100 - itemCost * 100);
This becomes;
change = (int)(5.00 * 100 - 4.57 * 100)
= 500 - 457
change = 43
Now the change owed is computed as:
change / 100.0 = 43/100.0 = 0.43
Hence change owed = 0.43
Next quarters are computed as:
quarters = change / 25;
This becomes:
quarters = 43/25
quarters = 1
Now the remaining is computed as:
change = change % 25;
This becomes:
change = 43 % 25;
change = 18
Next the dimes are computed from remaining value of change as:
dimes = change / 10;
dimes = 18 / 10
dimes = 1
Now the remaining is computed as:
change = change % 10;
This becomes:
change = 18 % 10
change = 8
Next the nickels are computed from remaining value of change as:
nickels = change / 5;
nickels = 8 / 5
nickels = 1
Now the remaining is computed as:
change = change % 5;
This becomes:
change = 8 % 5
change = 3
At last the pennies are computed as:
pennies = change;
pennies = 3
So the output of the entire program is:
Change Owed: 0.43 Quarters: 1 Dimes: 1 Nickels: 1 Pennies: 3
The screenshot of the output is attached.
why does this site suck so much?
Like why do I have to pay MONEY to get answers?
Answer:
you can answer ppl question to get points to ask questions
Explanation:
thats what i do and its free
Answer:
Money :))
They get revenue off of ads and that cash from your purchases to keep the site and themselves running.
AND REMEMBER: NOTHING IS FREEEEEEE
Codehs 9.4.6 word counts
The amount of words in a document or passage of text is referred to as the word count.
Why is word count important?When a manuscript must keep inside a specified amount of words, word counting may be required. This may be especially true in education, judicial procedures, media, and advertising.
The word count is significant since it allows you to choose your readers. For example, if you create a novel that is 100,000 words long, there will inevitably be some readers who will find it unsuitable (due to the word length).
Learn more about word count:
https://brainly.com/question/31310672
#SPJ1
Given an array, arr(0, 2,3,5, 4], and an integer x = 1, sort the array using the method below.
Answer:
Explanation:
arr = [0, 2, 3, 5, 4]
x = 1
arr.append(x)
sorted_arr = sorted(arr)
print(sorted_arr)
I am trying to figure out pseudocode for displaying a person's BMI based on BMI = weight x 703 / height x height.
QUESTION 1 Choose a term from COLUMN B that matches a description in COLUMN A. Write only the letter (A-L) next to the question number (1.1-1.10) in the ANSWER BOOK. COLUMN A 1.1. Substances that provide nourishment to the body 1.2. How you think and feel about something 1.3. Helps to cope with the challenges of being a student Exercise relating to increasing your heart rate 1.5. Having traits or qualities traditionally associated with 1.4. men 1.6. Seeing, hearing, or sensing something that is not really there 1.7. 1.8. Leaving everything till the last minute Is Chapter 2 in the Constitution of SA 1.9. Group of people who share notes and information 1.10. Ability to exercise for extended period of time COLUMN B A hallucination B nutrients C study group D procrastinate E endurance F Bill of Rights G Cardio-vascular H masculine I attitude J resilience K strength L flexibility
Answer:
1.1 B nutrients 1.2 I attitude 1.3 J resilience 1.4 H masculine 1.5 L flexibility 1.6 A hallucination 1.7 D procrastinate 1.8 F Bill of Rights 1.9 C study group 1.10 E endurance
Explanation:
True or False: Nanomemory applies to computers.
Answer:
True
Explanation:
The Huawei developed Nanomemory Card (used for phones) can also be used for computers. A nanomemory card is just like an SD card, it provides you with extra storage space. Computer memory is also measured in nanomemory, so it can be used. Therefore, the answer to the question is True.
Best of Luck!
You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to your place of work, and the fuel efficiency of your car (in miles per gallon). You also know the one-way price of a train ticket. You assume the cost of gas at $4 per gallon, and car maintenance at 5 cents per mile. Write an algorithm to decide which commute is cheaper.
Explanation:
Remember, an algorithm in simple words means a set of instructions or steps to be followed in other to solve a problem.
Note, to decide which commute is cheaper, it means the output of the algorithm should be the cheaper way to commute.
Using pseudocode do the following;
determine the inputs and outputs of the problem arrange the identified problem into micro-tasksdescribe each micro-tasks in the pseudocode Test the pseudocode by solving the problem.
Which of the following factors is least likely to result in delivery delays?
There are different factors that leads to delay in deliver. The most common factors that leads to delayed delivery are known as Misspelt, incomplete or outdated address.
What causes delay in delivery?There are Mistakes that leads to delay in delivery process. Example is a misspelled address, incorrectly details in forms that has been filled, and also incomplete information.
The above are known to be key factors or reasons for inaccurate or late deliveries.
Learn more about delay in delivery from
https://brainly.com/question/12938965
In cell E5, enter a formula without using a function that subtracts the start date for
the customer from the current date and divides the result by 365.25, the number
of days in a year, accounting for leap year.
Answer:
\(\boxed{\frac{(C2-E5)}{365.25}}\)
Explanation:
First, tap on cell E5. Add: = .
Next, tap cell C2. The current date of 11/02/2021, doing this, you would be presented: =C2 . Add: -. Then tap on D5.
The equation in E5: =C2-E5. It should be: \(= \frac{(C2-E5)}{365.25}\). Hover over C2 and tap F4. This renders the entire source.
Lastly, illustrate the input in cell E5 with one decimal place.
And office now has a total of 35 employees 11 were added last year the year prior there was a 500% increase in staff how many staff members were in the office before the increase
There were 5 staff members in the office before the increase.
To find the number of staff members in the office before the increase, we can work backward from the given information.
Let's start with the current total of 35 employees. It is stated that 11 employees were added last year.
Therefore, if we subtract 11 from the current total, we can determine the number of employees before the addition: 35 - 11 = 24.
Moving on to the information about the year prior, it states that there was a 500% increase in staff.
To calculate this, we need to find the original number of employees and then determine what 500% of that number is.
Let's assume the original number of employees before the increase was x.
If we had a 500% increase, it means the number of employees multiplied by 5. So, we can write the equation:
5 * x = 24
Dividing both sides of the equation by 5, we find:
x = 24 / 5 = 4.8
However, the number of employees cannot be a fraction or a decimal, so we round it to the nearest whole number.
Thus, before the increase, there were 5 employees in the office.
For more questions on staff members
https://brainly.com/question/30298095
#SPJ8
Write the pseudocode to this flowchart.
Answer:
I don't understand
Explanation:
Activity No.5
Project Implementation
Based on the Community Based Results, proposed programs/project to be implemented in your barangay/community
I. Title
II Project Proponents
III Implementing Proponents
IV Project Duration
V Objectives of the Project
VI Project Description
VII Methodology
VIIIDetailed Budgetary Requirements
IX Gantt Chart/ Detailed schedule of activities
In the activity related to Project Implementation, the following components are listed:
I. Title: This refers to the name or title given to the proposed program or project to be implemented in the barangay/community.
II. Project Proponents: These are the individuals or groups who are responsible for initiating and advocating for the project. They may include community leaders, organizations, or individuals involved in the project.
III. Implementing Proponents: These are the parties or organizations who will be responsible for executing and implementing the project on the ground. They may include government agencies, non-profit organizations, or community-based organizations.
IV. Project Duration: This refers to the estimated timeframe or duration within which the project is expected to be completed. It helps in setting deadlines and managing the project timeline.
V. Objectives of the Project: These are the specific goals or outcomes that the project aims to achieve. They define the purpose and desired results of the project.
VI. Project Description: This section provides a detailed explanation and overview of the project, including its background, context, and scope.
VII. Methodology: This outlines the approach, methods, and strategies that will be used to implement the project. It may include activities, processes, and resources required for successful project execution.
VIII. Detailed Budgetary Requirements: This section provides a comprehensive breakdown of the financial resources needed to implement the project. It includes estimates of costs for personnel, materials, equipment, services, and other relevant expenses.
IX. Gantt Chart/Detailed Schedule of Activities: This visual representation or detailed schedule outlines the specific activities, tasks, and milestones of the project, along with their respective timelines and dependencies.
These components collectively form a framework for planning and implementing a project, ensuring that all necessary aspects are addressed and accounted for during the execution phase.
For more questions on barangay, click on:
https://brainly.com/question/31534740
#SPJ8
In which of the following situations must you stop for a school bus with flashing red lights?
None of the choices are correct.
on a highway that is divided into two separate roadways if you are on the SAME roadway as the school bus
you never have to stop for a school bus as long as you slow down and proceed with caution until you have completely passed it
on a highway that is divided into two separate roadways if you are on the OPPOSITE roadway as the school bus
The correct answer is:
on a highway that is divided into two separate roadways if you are on the OPPOSITE roadway as the school busWhat happens when a school bus is flashing red lightsWhen a school bus has its flashing red lights activated and the stop sign extended, it is indicating that students are either boarding or exiting the bus. In most jurisdictions, drivers are required to stop when they are on the opposite side of a divided highway from the school bus. This is to ensure the safety of the students crossing the road.
It is crucial to follow the specific laws and regulations of your local jurisdiction regarding school bus safety, as they may vary.
Learn more about school bus at
https://brainly.com/question/30615345
#SPJ1
When writing technical information to a non-technical audience, you discover that the information appears to be geared more toward an expert audience. Which of the following strategies can help to adapt the writing to meet the needs of your audience?
When adapting technical information for a non-technical audience, several strategies can be employed to ensure clarity and understanding:
The StrategiesSimplify language: Replace technical jargon and acronyms with plain language that is easily understood by the general audience.
Define terms: If technical terms are necessary, provide clear definitions or explanations to help readers comprehend their meaning.
Use analogies: Relate complex concepts to familiar everyday situations or objects, making it easier for non-experts to grasp the ideas.
Break down complex ideas: Divide complex information into smaller, more manageable sections, and provide step-by-step explanations or examples.
Visual aids: Utilize visuals such as diagrams, charts, or infographics to supplement the text and enhance understanding.
Provide context: Frame technical information within a broader context to help readers understand its relevance and importance.
Test for comprehension: Seek feedback from non-technical individuals to gauge their understanding and make necessary revisions.
By implementing these strategies, you can effectively bridge the gap between technical content and a non-technical audience, facilitating comprehension and engagement.
Read more about technical information here:
https://brainly.com/question/7788080
#SPJ1
If a device has obtained an IP address using Link Local, which IP configuration would be within its subnet?
Answer:
If a device has obtained an IP address using Link Local, its IP configuration will be within the 169.254.0.0/16 subnet.
Explanation:
The Internet Engineering Task Force (IETF) has reserved the IPv4 address block 169.254 if a device received an IP address. 0.0/16
A link-local address is a unicast network address that is valid only for communications within the subnetwork to which the host is linked. Link-local addresses are typically issued automatically by a method known as stateless address autoconfiguration or link-local address autoconfiguration,[1] sometimes known as automatic private IP addressing (APIPA) or auto-IP. As a result, routers do not forward packets that have link-local source or destination addresses. IPv4 link-local addresses are assigned from the address block 169.254.0.0/16.
The Address Resolution Protocol (ARP) is used to convert between Layer 2 MAC addresses and Layer 3 IP addresses.ARP resolves IP addresses to MAC addresses by requesting, "Who owns the IP address 192.168.2.140, please inform me?" They are assigned from the block that may be configured inside its subnet.ARP resolves IP addresses to MAC addresses by requesting, "Who owns the IP address 192.168.2.140, please inform me?" They are assigned from the block that may be configured inside its subnet .ARP resolves IP addresses to MAC addresses by requesting, "Who owns the IP address 192.168.2.140, please inform me?" They are assigned from the block that may be configured inside its subnet.
ARP resolves IP addresses to MAC addresses by requesting, "Who owns the IP address 192.168.2.140, please inform me?" They are assigned from the block that may be configured inside its subnet.
select the signature for a helper method that calculates the student's gpa. public class student { private double mygpa; . . . } a. private void calcGPAC) b. public void calcGPA) c. private calcGPAC d. private int calcGPA
System software and application software are the two primary subcategories of software. Software that carries out specific tasks or satisfies needs is called an application. System software is created to run the hardware of a computer and provide a foundation for programs to run on.
What is private void calc GPAC?Private denotes that a method, function, or property is only usable within the class and is not accessible to outsiders. Public refers to a method, function, or property that can be used both inside and outside of the class.
AP Computer Science A is regarded as being fairly simple; class graduates gave it a difficulty grade of 4.3/10. (the 23rd-most-difficult out of the 28 large AP classes surveyed). Compared to other AP subjects, the pass rate is around average, and 67% of students graduate with a 3 or better.
They all have different professional paths and specializations or subfields, therefore there is no such thing as "better." Both fields of study are excellent choices for you.
Therefore the correct answer is option a )private void calcGPAC)
To learn more about private void refer to :
https://brainly.com/question/29667066
#SPJ4
what is the role of the operating system
A motor takes a current of 27.5 amperes per leaf on a 440-volt, three-phase circuit. The power factor is 0.80. What is the load in watts? Round the answer to the nearer whole watt.
The load in watts for the motor is 16766 watts
To calculate the load in watts for the given motor, you can use the following formula:
Load (W) = Voltage (V) × Current (I) × Power Factor (PF) × √3
In this case:
Voltage (V) = 440 volts
Current (I) = 27.5 amperes per phase
Power Factor (PF) = 0.80
√3 represents the square root of 3, which is approximately 1.732
Now, plug in the values:
Load (W) = Voltage (V) × Current (I) × Power Factor (PF) × √3
Load (W) = 440 × 27.5 × 0.80 × 1.732
Load (W) = 16765.7 watts
Rounded to the nearest whole watt, the load is approximately 16766 watts.
Know more about the motor here :
https://brainly.com/question/29713010
#SPJ11
Help me with this digital Circuit please
A subset of electronics called digital circuits or digital electronics uses digital signals to carry out a variety of tasks and satisfy a range of needs.
Thus, These circuits receive input signals in digital form, which are expressed in binary form as 0s and 1s. Logical gates that carry out logical operations, including as AND, OR, NOT, NANAD, NOR, and XOR gates, are used in the construction of these circuits.
This format enables the circuit to change between states for exact output. The fundamental purpose of digital circuit systems is to address the shortcomings of analog systems, which are slower and may produce inaccurate output data.
On a single integrated circuit (IC), a number of logic gates are used to create a digital circuit. Any digital circuit's input consists of "0's" and "1's" in binary form. After processing raw digital data, a precise value is produced.
Thus, A subset of electronics called digital circuits or digital electronics uses digital signals to carry out a variety of tasks and satisfy a range of needs.
Learn more about Digital circuit, refer to the link:
https://brainly.com/question/24628790
#SPJ1
Which one do you think Microsoft PowerPoint would go under
Utility
Entertainment
Education
Productivity
Answer:
D. Productivity
Explanation:
Productivity Application: an application that helps the user be more productive in business or school tasks
which person would be the best fit for a career in infomation technology field?
Answer:
The person that would be the best fit for a career in the Information Technology field is a creative person with a flexible mind.
Explanation:
What are the core steps to add revisions or features to a project?(1 point)
Responses
Evaluate feasibility of the goals, create a list of functionality requirements, and develop the requirements of the feature.
Evaluate feasibility of the goals, develop programming solutions, and evaluate how well the solutions address the goals.
understand the goals, evaluate the impact on the project, create a list of functionality requirements, and develop the requirements of the feature.
Communicate with the client, create a sprint backlog, develop the project, and evaluate how well the solution fits the requirements.
The core steps to add revisions or features to a project are ""Understand the goals, evaluate the impact on the project, create a list of functionality requirements, and develop the requirements of the feature." (Option C)
How is this so?
The core steps to add revisions or features to a project include understanding the goals,evaluating the impact on the project, creating a list of functionality requirements,and developing the requirements of the feature.
These steps ensure that the goals are clear, the impact is assessed, and the necessary functionality is identified and implemented effectively.
Learn more about project management at:
https://brainly.com/question/16927451
#SPJ1
a simple structured program in c++ to calculate average of n items
Answer:
#include <iostream>
using namespace std;
int main ()
{
int n, i;
float sum = 0.0, average;
cout << "Enter the number of items:";
cin >> n;
float num[n];
for(i = 0; i < n; ++i)
{
cout << "Enter a number: ";
cin >> num[i];
sum += num[i];
}
average = sum / n;
cout << "Average = " << average;
return 0;
}
Explanation:
OK, I let ChatGPT write this one, but it is a proper solution. You can simplify it by not storing each number in an array element. This is because other than adding it to the sum, you don't need these numbers.
Place yourself in the position of a network designer. You have customers that are looking to improve their network but need your help. Read over each scenario to get an idea of what the customer currently has and what they will need of the new network. Customer may not always know exactly what they need so reading in between the lines is a great skill to start working on.
After picking out the requirements the customer is in need of solving, complete research on real world devices that may be a good fit for them. This can include new devices, services and cables depending on the customers' needs. Once you have finished your research make a list of the devices you are recommending to the customer. Each device/service will need an explanation on why you chose it, the price, link to the device and a total budget for reach scenario. Think of your explanation as a way of explaining to the customer why this device would fit their specific needs better than another one.
There is no one way of designing any network. Your reasoning for choosing a device is just as important as the device itself. Be creative with your design!
Scenario A: young married couple, the husband is an accountant, and the wife is a graphic designer. They are both now being asked to work from home. Their work needs will be mainly accessing resources from their offices but nothing too large in file size. They have a 2-story townhome with 1600 square feet space. There is a 2nd floor master bedroom with a streaming device, a 1st floor office space with a streaming device and living room with a 3rd streaming device. The wife works from the master bedroom while the husband works mainly in the office space. Their ISP is a cable provider, and they have a 200 Mbps download and a 50 Mbps upload service account. The cable modem is in the office space and they currently pay $5 a month to have an integrated wireless access point (WAP) but no ethernet capability. The office space will need to have a LaserJet printer connected to the network via ethernet Cat-5E cable. They want to stop paying the monthly $5 and have their own WAP. The WAP needs to have an integrated switch that can provide them reliable work-from-home connectivity, with at least 4 ethernet ports for growth, and steady streaming capability for their personal viewing. Budget for the network infrastructure improvement is under $2500.
The Ubiquiti Networks UniFi Dream Machine (UDM) is the perfect instrument to fulfill the couple's networking requirements.
What does it serve as?The all-inclusive device serves as a Router, Switch, Security gateway, and WAP delivering stable home-working performance. It provides four Ethernet ports operating at the most advanced WiFi 6 specifications, enabling convenient streaming for entertainment.
Besides its user-friendly mobile app assisting with setting up and management processes, the UDM accommodates VLANs so users can segment their network in order to heighten security.
Costing around $299 – obtainable from either Ubiquiti’s site or Amazon - and Cat-6 Ethernet cables costing roughly $50 for every five on Amazon, the total expenditure comes to $350, conveniently fitting in the prearranged budget of $2500.
Read more about budget here:
https://brainly.com/question/6663636
#SPJ1
what is data analysing data and give three examples ?
Answer:
Data Analysis is the process of systematically applying statistical and/or logical techniques to describe and illustrate, condense and recap, and evaluate data. ... An essential component of ensuring data integrity is the accurate and appropriate analysis of research findings.
Inferential Analysis. Diagnostic Analysis. Predictive Analysis. Prescriptive Analysis are examples.
discuss MIS as a technology based solution must address all the requirements across any
structure of the organization. This means particularly there are information to be
shared along the organization
MIS stands for Management Information System, which is a technology-based solution that assists organizations in making strategic decisions. It aids in the efficient organization of information, making it easier to locate, track, and manage. MIS is an essential tool that assists in the streamlining of an organization's operations, resulting in increased productivity and reduced costs.
It is critical for an MIS system to address the needs of any organization's structure. This implies that the information gathered through the MIS should be easily accessible to all levels of the organization. It must be capable of handling a wide range of activities and functions, including financial and accounting data, human resources, production, and inventory management.MIS systems must be scalable to meet the needs of a company as it expands.
The information stored in an MIS should be able to be shared across the organization, from the highest to the lowest level. This feature allows for smooth communication and collaboration among departments and employees, which leads to better decision-making and increased productivity.
Furthermore, MIS systems must provide a comprehensive overview of a company's operations. This implies that it must be capable of tracking and recording all relevant information. It should provide a real-time picture of the company's performance by gathering and analyzing data from a variety of sources. As a result, businesses can take quick action to resolve problems and capitalize on opportunities.
For more such questions on Management Information System, click on:
https://brainly.com/question/14688347
#SPJ8
Why is hydroelectricity counted as a conventional source of energy.. People say conventional sources of energy is the same as non-renewable energy sources
QUESTION 5 OF 30
Burnout can happen quickly when
working with multiple sysadmins
working overtime
working as the sole sysadmin
Answer:
Burnout can happen quickly when working with multiple sysadmins, working overtime, or working as the sole sysadmin.
Explanation:
Given three subroutines of 550, 290, and 600 words each, if segmentation is used then the total memory needed is the sum of the three sizes (if all three routines are loaded). However, if paging is used, then some storage space is lost because subroutines rarely fill the last page completely, and that results in internal fragmentation. Determine the total amount of wasted memory due to internal fragmentation when the three subroutines are loaded into memory using each of the following page sizes:
a. 100 words
b. 600 words
c. 700 words
d. 900 words
Typically, external fragmentation wastes one-third of memory. Internal fragmentation occurs when space inside a designated region is wasted. Thus, option D is correct.
What wasted memory due to internal fragmentation?The mounted-sized block is allotted to a method whenever a request for memory is made. Internal fragmentation is the term used to describe the situation where the memory allotted to the method is a little bigger than the amount requested.
Normally, memory is allocated in uniformly sized blocks, but sometimes a process doesn't use the entire block, leading to internal fragmentation.
Memory fragmentation occurs when a memory allocation request can be satisfied by the whole amount of accessible space in a memory heap, but no single fragment (or group of contiguous fragments) can.
Therefore, when the three subroutines are loaded into memory using each of the following page sizes 900 words.
Learn more about memory here:
https://brainly.com/question/16953854
#SPJ5
Write a class encapsulating the concept of an investment, assuming
that the investment has the following attributes: the name of the
investor, the amount of the investment, and the static interest rate at
which the investment will be compounded. Include a default
constructor, an overloaded constructor, the accessors and mutators,
and methods, toString() and equals(). Also include a method returning
the future value of the investment depending on how many years
(parameter to this method) we hold it before selling it, which can be
calculated using the formula:
Future value = investment(1 + interest rate )year
We will assume that the interest rate is compounded annually. Write a
client class to test all the methods in your class and print out the tuture
value of and investment for 5, 10, and 20 years.
A class encapsulating the concept of an investment, assuming that the investment has the following attributes is given below:
The Programimport java.util.Scanner;
/**
This program compares CD /Investment plans input by the year
broken down by the requirements below:
This program creates a table of compound interest investment growth over time
Broken down by: a) year b) balance at end of year
Finance formula of A= P(1+ r/n)^n*t is used:
A = Future Value | P = Initial Investment
r = annual interest rate |n = times interest is compounded/year
t = years invested
*/
public class InvestmentTableFirstTest
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
String bestBankName = "";
double bestGrowth = 0;
boolean done = false;
while(!done)
{
System.out.print("Plan name (one word, Q to quit): ");
String bankName = in.next();
if (bankName.equals("Q"))
{
done = true;
}
else
{
System.out.print("Please enter your principal investment: ");
final double PRINCIPAL_INVESTMENT = in.nextDouble();
System.out.print("Please enter the annual interest rate: ");
double iRate = in.nextDouble();
System.out.print("Please enter number of times interest is compounded per year: ");
final double INCREMENT = in.nextDouble();
System.out.print("Enter number of years: ");
int nyears = in.nextInt();
iRate = iRate/100; System.out.println("iRate:" + iRate);
//Print the table of balances for each year
for (int year = 1; year <= nyears; year++)
{
double MULTIPLIER = INCREMENT * year;
System.out.println("Multiplier: " + MULTIPLIER); // I've included this print statement to show that the multiplier changes with each passing year
double interest = 1 + (iRate/INCREMENT);
double balance = PRINCIPAL_INVESTMENT;
double growth = balance * Math.pow(interest, MULTIPLIER);
growth = growth - PRINCIPAL_INVESTMENT;
balance = balance + growth;
System.out.printf("Year: %2d Interest Earned: $%.2f\t Ending Balance: $%.2f\n", year, growth, balance);
if (bestBankName.equals("") || bestGrowth > growth) // || bestBankName > growth
{
bestBankName = bankName; // bestBankName = bankName
bestGrowth = growth; // mostGrow = growth
}
System.out.println("Earning with this option: " + growth);
}
}
}
System.out.println("Best Growth: " + bestBankName);
System.out.println("Amount Earned: " + bestGrowth);
}
}
Read more about programming here:
https://brainly.com/question/23275071
#SPJ1