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
Hitman42 [59]
3 years ago
7

Please help asap

Computers and Technology
1 answer:
NNADVOKAT [17]3 years ago
5 0

Answer:

a. Comparison of if-else and elif:

if else follow as:

If (Condition)

{

In case if condition true, expression in this section executes

}

else

{

In case condition is false, expression in this section executes

}

elif Statement follows as:

If (Condition)

{

In case if condition true, expression in this section executes

}

{

in case, condition is false, move to elif block

elif (Condition)

{

In case elif condition true, expression in this section executes

}

else

{

In case elif condition is false, expression in this section executes

}

}

Explanation:

In if else, program first check the condition in "if statement", if condition is true it move into the body of "if " and execute the expression. If the condition is false it moves to the body of "else" and execute the expression.

elif is another block of condition in If else condition,It works as in "if statement" if the condition is true the program executes the expression of body of "if body". If the condition is false, it moves to another block of "elif", where it again check some other condition found in "elif statement". If the condition of "elif statement" is true it executes the expression of "elif body" otherwise in case of false condition it execute the expression in "else body".

It follows as: if - elif-else

Answer

b. the relational operators

Relation operators are the operators that are need in the expression to establish relationship between different operands of the expression.

Explanation:

In few expressions, their are some operators used to establish or show the relationship between different operands. These operator could be Equal (=), Greater than(>), Less than (<), Greater than equal to (>=) and Less than Equal to (<=).

These operators can be used in conditional statements that are used to check the relationship between operands and values through these operators.

Example

if (a>5)

{

if value of is greater than 5 then body of if will execute.

}

else

{

If value of a is less or equal to 5, this section will execute.

}

You might be interested in
Define binary number and decimal number with example​
photoshop1234 [79]

Answer:

The Decimal Number System is a number system for which every real number x can be written in terms of the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 as the sum of powers of 10. A number in the decimal number system is said to be of base 10 and to specify this we attach a subscript 10 to x, written (x)10.

The Binary Number System is a number system for which every real number x can be written in terms of the two digits 0 and 1 as the sum of powers of 2. A number written in the binary number system is said to be of base 2, and to specify this we attach a subscript 2 to x, written (x)2.

4 0
3 years ago
Anyone here codes? <br> C++, C#, Lua? Anything?
Travka [436]

Answer:

IxxyzjgzkgzjgKfzkg v

jvljcljxkhxkgg/gjhkggzkykzkgjzjgggggzjgcufxu

Explanation:

nk yxthzefhGghghrhgzxhhsdgchiixxu

7 0
3 years ago
Read 2 more answers
Which sentance has correct capitalization? A) I can't wait for fall to come because I love Halloween. B) I can't wait for Fall t
nordsb [41]

Answer: should be A i think because the word “fall” does not require capitalization.

Explanation:

3 0
3 years ago
Define stubs for the functions called by the below main(). Each stub should print "FIXME: Finish FunctionName()" followed by a n
joja [24]

Answer:

A stub method or merely a stub in software development is a code piece that performs various other programming functionality. It can copy the existing code behavior like a procedure on a remote machine like methods are quite frequently known as mocks or for a while working for a code that has not yet been developed.

Please check the explanation for more details.

Explanation:

A method stub in this intelligence is a method with no factual material, i.e. it's not deed what it is intended to do. Your getUserNum() method must return a user's unique ID, but in its place, you're indispensable a stub that merely returns -1 on every request.

Through the main method, you should define these methods:

Num1=getUserNum();

Num2=getUserNum();

avgResult = computeAvg(Num1, Num2);

Hence, define them. And below is how the above stub function should be like:

public static int getUserNum(){

System.out.println("FIXMR:Finish getUserNum()");

return -1;

And the whole program should look like:

import java.util.Scanner;

public class Main {

public static int getUserNum ()

{

System.out.println("FIXME: Finish getUserNum()");

return -1;

}

public static int computeAvg(int Num1, int Num2)

{

int avgResult = (Num1 + Num2)/2;

System.out.println("FIXME: Finish computeAvg()"); return -1;

}

public static void main(String[] args)

{

int Num1 = 0;

int Num2 = 0;

int avgResult = 0;

Num1 = getUserNum(); Num2 = getUserNum();

avgResult = computeAvg(Num1, Num2);

System.out.println("Avg: " + avgResult);

return;

}

}

3 0
3 years ago
Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
MA_775_DIABLO [31]

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    const int NUM_VALS = 4;
  6.    int hourlyTemp[NUM_VALS];
  7.    int i;
  8.    
  9.    for (i = 0; i < NUM_VALS; ++i)
  10.    {
  11.        cin >> hourlyTemp[i];
  12.        
  13.    }
  14.    
  15.    /* Your solution goes here */
  16.    for(i = 0; i < NUM_VALS; ++i){
  17.        
  18.        if(i < NUM_VALS -1){
  19.            cout<<hourlyTemp[i]<<",";
  20.        }
  21.        else{
  22.            cout<<hourlyTemp[i];
  23.        }
  24.    }
  25.    cout << endl;
  26.    return 0;
  27. }

Explanation:

The solution code is given from Line 18 - 26. To print the element from array one after another, we create a for loop to traverse through every element in the array (Line 18). Create an if condition to check if the current index i is not the last index, print the element followed with a comma (Line 20 -22). Otherwise print only the element (Line 23 - 25).

8 0
3 years ago
Other questions:
  • Create a different version of the program that: Takes a 3-digit number and generates a 6-digit number with the 3-digit number re
    14·1 answer
  • most dialog boxes in windows programs requiring navigation follow a similar procedure. true or false.
    7·1 answer
  • What are the 6 external componets to a computer?
    7·1 answer
  • What change does NOT need to be made to the above cover letter excerpt before sending it to an employer? a. Remove background co
    6·2 answers
  • Identify four basic data manipulations performed on a relational database using sql
    7·1 answer
  • Which are examples of copyrighted online materials? Check all that apply.
    14·2 answers
  • Special variables that hold copies of function arguments are called _________.
    11·1 answer
  • C. There are two types of computer on the basis of size. true or false​
    5·1 answer
  • What is the most vulnerable information that should be protected to prevent unauthorized access to your online files and records
    8·1 answer
  • This road sign means
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!