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
ASHA 777 [7]
2 years ago
14

Assign a variable solve Equation with a function expression that has three parameters (x, y, and z) and returns the result of ev

aluating the expression z-y+2*x
Computers and Technology
1 answer:
tangare [24]2 years ago
5 0

Answer: Following is a python code

def solveEquation(x,y,z):

   res=z-y+(2*x)  #stores expression's value

   return res

solveEquation(2,1,4)  #calls function

OUTPUT :

7

Explanation:

In the above code solveEquation is the function which takes three arguments x,y and z and their type is decided while calling the function and passing the values to these arguments. After the values are passed, an equation is written which is solved and the result is stored in variable res and then that variable's value is returned.

You might be interested in
In which type of attack do you get malicious code in links from seemingly reliable websites?
natali 33 [55]

I think it is C. cross-site scripting

6 0
2 years ago
Cheri needs to write a small program that interacts with the user. What step will allow her to do this?
Alinara [238K]

Answer:

Including a input statement

Explanation:

You need a input statement in order for it to work, here´s an example;

script.parent.click <u>then</u>

you need the ¨.mouse¨ after parent or it wouldnt work.

8 0
3 years ago
Read 2 more answers
Write a method named removeDuplicates that accepts a string parameter and returns a new string with all consecutive occurrences
Nitella [24]

Answer:

//Method definition

//Method receives a String argument and returns a String value

public static String removeDuplicates(String str){

       //Create a new string to hold the unique characters

       String newString = "";

       

       //Create a loop to cycle through each of the characters in the

       //original string.

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

           // For each of the cycles, using the indexOf() method,

           // check if the character at that position

           // already exists in the new string.

           if(newString.indexOf(str.charAt(i)) == -1){

               //if it does not exist, add it to the new string

               newString += str.charAt(i);

           }  //End of if statement

       }   //End of for statement

       

       return newString;   // return the new string

   }  //End of method definition

Sample Output:

removeDuplicates("bookkeeeeeper") => "bokeper"

Explanation:

The above code has been written in Java. It contains comments explaining every line of the code. Please go through the comments.

The actual lines of codes are written in bold-face to distinguish them from comments. The program has been re-written without comments as follows:

public static String removeDuplicates(String str){

       String newString = "";

       

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

           if(newString.indexOf(str.charAt(i)) == -1){

               newString += str.charAt(i);

           }

       }

       

       return newString;

   }

From the sample output, when tested in a main application, a call to removeDuplicates("bookkeeeeeper") would return "bokeper"

7 0
2 years ago
How might your use of computers and knowledge of technology systems affect your personal and professional success?
Xelga [282]
Amost all professions include theuse of computers. Knowing a lot about them and the way they work could help you use them when needed in a work environment. It would also make an employer more likely to hire you.
6 0
3 years ago
Read 2 more answers
(EASY)
AnnyKZ [126]
If you go to a college website you will see the it has .edu in the URL extensions.
3 0
2 years ago
Read 2 more answers
Other questions:
  • A storyboard is an example of an implementation tool.<br><br> A.<br> True<br><br> B.<br> False
    8·2 answers
  • What was the first fully computer animated feature film?
    13·1 answer
  • What can act as a buffer against unemployment
    11·1 answer
  • A digital designer might do computer animation or video games true or false
    13·2 answers
  • Vendors who use open source as part of their product offerings can expect to bring new products to the market faster because: Gr
    11·1 answer
  • You would like to narrow your search on this topic.
    15·2 answers
  • How can injection attacks be prevented? Check all that apply
    6·2 answers
  • Reply emailing a student who is asking about audio materials​
    6·2 answers
  • Micheal is the project manager in a company. He wants his organization to use technology for higher revenue and productivity. Wh
    13·1 answer
  • NEED HELP QUICK!!!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!