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
Slav-nsk [51]
3 years ago
6

Given an array of ints named x and an int variable named total that has already been declared, write some code that places the s

um of all the elements of the array x into total. Declare any variables that you need.
Computers and Technology
1 answer:
Marizza181 [45]3 years ago
8 0

Answer:

Following are the code:

Code:

total = 0; //assign value to total variable.

for (int i=0; i<x.length; i++) //for loop

{

total=total+x[i]; //add all array elements in total variable.

}

Explanation:

In the following question, it is defined that x and total is variable. Where variable x is an integer type array and total is an integer variable. we define some code for calculating the sum of the array element. In the above code, we use for loop that calculates sum of array elements that can be described as:

  • To calculate the sum we use the total variable. In total variable, we assign value 0.
  • Then we define for loop in loop we use total variables that add all array (x[]) elements.

You might be interested in
While creating a sketch, what helps you identify positive and negative space?
Eduardwww [97]

Answer:      positive = plus sign and negativie = subraction sign

Explanation:

7 0
3 years ago
Robert is working on an image as part of his school project. he has to do multiple edits on the file. what is a good practice fo
kenny6666 [7]
D, save the file in multiple formats at the beginning
8 0
3 years ago
Next
umka21 [38]

Answer:

script=java

makeup=Html

css=text

dom=document

Explanation:

3 0
2 years ago
Create a program named Auction that allows a user to enter an amount bid on an online auction item. Include three overloaded met
Olin [163]

Answer:

Explanation:

The following code is written in Java and creates the overloaded methods as requested. It has been tested and is working without bugs. The test cases are shown in the first red square within the main method and the output results are shown in the bottom red square...

class Auction {

   public static void main(String[] args) {

       bid(10);

       bid(10.00);

       bid("10 dollars");

       bid("$10");

       bid("150 bills");

   }

   public static void bid(int bid) {

       if(bid >= 10) {

           System.out.println("Bid Accepted");

       } else {

           System.out.println("Bid not high enough");

       }

   }

   public static void bid(double bid) {

       if(bid >= 10) {

           System.out.println("Bid Accepted");

       } else {

           System.out.println("Bid not high enough");

       }

   }

   public static void bid(String bid) {

       if (bid.charAt(0) == '$') {

           if (Integer.parseInt(bid.substring(1, bid.length())) > 0) {

               System.out.println("Bid Accepted");

               return;

           } else {

               System.out.println("Bid not in correct Format");

               return;

           }

       }

       int dollarStartingPoint = 0;

       for (int x = 0; x < bid.length(); x++) {

           if (bid.charAt(x) == 'd') {

               if (bid.substring(x, x + 7).equals("dollars")) {

                   dollarStartingPoint = x;

               } else {

                   break;

               }

           }

       }

       if (dollarStartingPoint > 1) {

           if (Integer.parseInt(bid.substring(0, dollarStartingPoint-1)) > 0) {

               System.out.println("Bid Accepted");

               return;

           } else {

               System.out.println("Bid not in correct format");

               return;

           }

       } else {

           System.out.println("Bid not in correct format");

           return;

       }

   }

}

3 0
3 years ago
Tom is an aspiring animator. What qualification does he need to increase his chances of employment? A. bachelor’s degree in comp
dangina [55]

Answer:

A: bachelors in computer graphics

A computer animation related degree

Explanation:

Animation has its own degree field, a related field would be computer graphics, fine art, or graphic arts.  They can have a 2 year degree or 4. some employers require a portfolio or experience with certain software.

6 0
3 years ago
Other questions:
  • With a(n) ____ the editor, compiler, and executer are combined in the same application.
    7·1 answer
  • Interactive sites were usually is right about important topics and comments to a threaded discussion are called
    9·1 answer
  • Kendall receives an email stating that a leading computer company is giving away free computers, asking her to forward the email
    15·1 answer
  • Which kind of software allows users to draw pictures, shapes, and other graphical images with various on-screen tools such as a
    14·1 answer
  • reading is important blank areas of life A in very few B in many C only in academic D only in career​
    10·1 answer
  • Select all that apply.
    5·1 answer
  • Hannah wants to write a book about how scientists and society interact, and she has generated ideas for chapters. Which chapter
    13·1 answer
  • True/false questions are useful in determining a student’s ability to____information
    8·1 answer
  • Which tags do you use to write the header and items of an ordered list on a web page?
    14·1 answer
  • Help me with this question asap please :)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!