Course Solutions Uncategorized (Solved) : Java Write Declaration Populates Array Following Numbers 21 43 10 Prints Following Format Q32006464 . . . .

(Solved) : Java Write Declaration Populates Array Following Numbers 21 43 10 Prints Following Format Q32006464 . . . .

 

(JAVA )Write a declaration that populates an array with thefollowing numbers
21, 43, 10
then prints them out in the following format:
[a0, a1, a2, …,an]
and finally prints the alternating sum on a new line –
that is, if the array index is even add the value to thetotal,
or if the array index is odd subtract the value from the total

For example:

Result[21, 43, 10]-12

the output should completely same with the Result

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Isnt Mycalenderjava Working Class Mycalenderjava Package Calenderapp Import Javautilscanne Q38158184 . . . .(Solved) : Isnt Mycalenderjava Working Class Mycalenderjava Package Calenderapp Import Javautilscanne Q38158184 . . . .

<p>Why isnt my MyCalender.java working?</p><p><strong>class MyCalender.java :</strong></p><p><br/>package calenderapp;</p><p>import java.util.Scanner;</p><p>public class MyCalender {<br/>MyDate myDate;<br/>Day day;<br/>enum Day {<br/>Monday,<br/>Tuesday,<br/>Wednesday,<br/>Thursday,<br/>Friday,<br/>Saturday,<br/>Sunday<br/>}<br/>  <br/>public static void main(String[] args) {<br/>Scanner sc= new Scanner(System.in);<br/>System.out.println("Enter date below :");<br/>System.out.println("Enter day :");<br/>int day