Answer.
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
GREYUIT [131]
1 year ago
7

Assume that a Money variable yearlySales has also been declared. Write the necessary code that traverses the monthlySales array

and adds it all up and stores the resulting total in yearlySales. Be sure make sure that yearlySales ends up with a valid value, i.e. a value of cents that is less than 100.
Computers and Technology
1 answer:
Alex_Xolod [135]1 year ago
3 0

Answer:

public class num3 {

   public static void main(String[] args) {

   double yearlySales =0;

   int [] monthlySales = new int[12];

   for(int i = 0; i<monthlySales.length; i++) {

       yearlySales= yearlySales += monthlySales[i];

   }

}

}

Explanation:

Declare the variable yearlySales and initialize to 0.

Create an Array of ints monthlySales, set its length to 12

Using a for loop, add up all the elements in array and store in the varible yearly sales.

You might be interested in
How do I learn javascript/java for free?​
ahrayia [7]

abcbacdefrterdss1234

7 0
1 year ago
Which are options available for formatting tables? Check all that apply.
denpristay [2]

Hey,

so the sort answer is all but B "including quotes"

the long answer is that all of them but b are for formatting aka style.

Hope this helps

-scav

5 0
1 year ago
Read 2 more answers
Rachel should use the feature in a word processing program to find typographical errors. She should apply to have uniform headin
Kay [80]
Yes that is a good starter
5 0
1 year ago
When were the first successful photographs made using a camera?
Mkey [24]
During the civil war to show Americans at home how bad it was.
4 0
1 year ago
When a developer creates an application for each type of device that might be used, this is referred to as ________.
shusha [124]

Answer:

he killed people

Explanation:

3 0
1 year ago
Other questions:
  • Given the following stream of accesses to a 4-block fully associative cache with LRU replacement, determine whether the access i
    8·1 answer
  • Which string displayed using the ls –l command in a Linux terminal indicates that group permissions are set to read and modify?
    9·1 answer
  • Photography, two questions, need help ASAP?
    15·2 answers
  • What does spyware do on your computer?
    12·1 answer
  • A friend was just promoted to a new job that requires part-time travel, and he has also been promised a new laptop after his fir
    14·1 answer
  • How to delete a previous action?
    14·2 answers
  • For how many integer values of $n$ between 1 and 1000 inclusive does the decimal representation of $\frac{n}{1400}$ terminate?
    7·1 answer
  • Pinhole cameras use a conflex lens.<br> True<br> False
    15·1 answer
  • Which are aspects of the post-production stage?
    9·1 answer
  • ________ is a human-computer interaction method whereby inputs to and outputs from a computer-based application are in a convent
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!