Northern Virginia Community College Java Programming Code
7D 1
Part1
Create and load parallel arrays that will hold this data
Create a method that will calculate the total sales for all 5 years
o You can create the method wherever you like
o The method will receive just the sales array (not the year array)
o The method will add up all of the sales
o The method will return the total amount of all sales
o Output the total in the main() with a message “Total sales from XXXX-XXXX”. Use the year array to
Part 2
In the main :
Display ALL years to the user (from the array)
Ask the user to enter a year 2017-2021
1
Search the array for that year
Output the associated annual sales
BIU
▼
A A T
▼
Tx²x₂ = 12pt
742 43
35
D 1
T
Write a Java program to solve the following problem:
A company (Halima Industries) has sales history for the past 5 years.
These are the past 5 years with the annual sales for each year.
2021
$503,000
2020 $813,000
2019 $856,000
2018 $659,000
2017 $525,000
Part1
Create and load parallel arrays that will hold this data
Create a method that will calculate the total sales for all 5 years
o You can create the method wherever you like
o The method will receive just the sales array (not the year array)
o The method will add up all of the sales
o The method will return the total amount of all sales
o Output the total in the main() with a message “Total sales from XXXX-XXXX”. U
Part 2
In the main:
Display ALL years to the user (from the array)
Ask the user to enter a year 2017-2021
Top-quality papers guaranteed
100% original papers
We sell only unique pieces of writing completed according to your demands.
Confidential service
We use security encryption to keep your personal data protected.
Money-back guarantee
We can give your money back if something goes wrong with your order.
Enjoy the free features we offer to everyone
-
Title page
Get a free title page formatted according to the specifics of your particular style.
-
Custom formatting
Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.
-
Bibliography page
Don’t pay extra for a list of references that perfectly fits your academic needs.
-
24/7 support assistance
Ask us a question anytime you need to—we don’t charge extra for supporting you!
Calculate how much your essay costs
What we are popular for
- English 101
- History
- Business Studies
- Management
- Literature
- Composition
- Psychology
- Philosophy
- Marketing
- Economics