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
Nataliya [291]
3 years ago
5

What will you see on the next line? >>> int(19.725)

Computers and Technology
1 answer:
Aleks [24]3 years ago
5 0

Answer:

In the next line, you would see the value 19

Explanation:

This is because in the C++ programming language the int() function being used in this question takes a double value as an argument and rounds it down to the nearest whole number. Therefore, since in this scenario the argument being passed is 19.725, if we round it down to the nearest whole number we would get 19. The int() function does this and returns the value 19 in the next line.

You might be interested in
Explain the importance of calculating a robot’s ability to extend its arm
MArishka [77]

Answer:

robot's importance

Explanation:

An industrial robot is equipped with many metrological or measurable properties that directly influence the efficiency of the robot during its performance. Repetitiveness and accuracy are the main measurable features. In general, a robot's repetitiveness might be defined as its ability to perform the same task repeatedly. On the other hand, precision is the difference (i.e. the mistake) between the requested task and the achieved task. Its concepts are often confused in robotics when it comes to repeatability and accuracy.Therefore, repeatability is always doing the same thing, while accuracy always reaches your target.

7 0
3 years ago
Write a function: function solution(N); that, given a positive integer N, prints the consecutive numbers from 1 to N, each on a
koban [17]

Answer:

<em>The program written in Python is as follows:</em>

def solution(N):

     concat = ""

     for i in range(1,N+1):

           if not(i%2 == 0 or i%3 ==0 or i%5 == 0):

                 print(str(i))

           else:

                 if i%2 == 0:

                       concat= concat+"Codility"

                 if i%3 == 0:

                       concat= concat+"Testers"

                 if i%5 == 0:

                       concat= concat+"Coders"

                 print(concat)

                 concat = ""

N = int(input("Enter a positive integer: "))

solution(N)

Explanation:

This line declares the function

def solution(N):

This line initializes a variable named concat to an empty string

     concat = ""

This line iterates from 1 to the input integer

     for i in range(1,N+1):

<em>This line checks if the current number of iteration is divisible by 2,3 or 5, if no, the number is printed</em>

           if not(i%2 == 0 or i%3 ==0 or i%5 == 0):

                 print(str(i))

<em>If otherwise</em>

           else:

<em>This lines checks if current number is divisible by 2; if yes the string "Codility" is concatenated to string concat</em>

                 if i%2 == 0:

                       concat= concat+"Codility"

<em>This lines checks if current number is divisible by 3; if yes the string "Testers" is concatenated to string concat</em>

<em>                 </em> if i%3 == 0:

                       concat= concat+"Testers"

<em>This lines checks if current number is divisible by 2; if yes the string "Coders" is concatenated to string concat</em>

                 if i%5 == 0:

                       concat= concat+"Coders"

<em>The concatenated string is printed using this line</em>

                 print(concat)

This variable concat is intialized back to an empty string

                 concat = ""

The main method starts here

N = int(input("Enter a positive integer: "))

This line calls the defined function solution

solution(N)

6 0
3 years ago
Create a Flash Card class. Flash Cards have a Question and an Answer, each of which are Strings. Your class should include a con
xeze [42]

Answer:

<u> FlashCard.java</u>

  1. public class FlashCard {
  2.    String Question;
  3.    String Answer;
  4.    public FlashCard(String q, String a){
  5.        this.Question = q;
  6.        this.Answer = a;
  7.    }
  8.    public String toString(){
  9.        String output = "";
  10.        output += "Question: " + this.Question + "\n";
  11.        output += "Answer: " + this.Answer;
  12.        return output;
  13.    }
  14.    public boolean equals(String response){
  15.        if(this.Answer.equals(response)){
  16.            return true;
  17.        }
  18.        else{
  19.            return false;
  20.        }
  21.    }
  22. }

<u>Main.java</u>

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        FlashCard card1 = new FlashCard("What is highest mountain?", "Everest");
  4.        FlashCard card2 = new FlashCard("What is natural satelite of earth?", "Moon");
  5.        FlashCard card3 = new FlashCard("Who is the first president of US?", "George Washington");
  6.        FlashCard cards [] = {card1, card2, card3};
  7.        for(int i=0; i < cards.length; i++){
  8.            System.out.println(cards[i]);
  9.        }
  10.    }
  11. }

Explanation:

In FlashCard.java, we create a FlashCard class with two instance variable, Question and Answer (Line 2 - 3). There is a constructor that takes two input strings to initialize the Question and Answer instance variables (Line 5-8). There is also a toString method that will return the predefined output string of question answer (Line 10 - 15). And also another equals method that will take an input string and check against with the Answer using string equals method. If matched, return True (Line 17 -24).

In Main.java, create three FlashCard object (Line 3-5) and then put them into an array (Line 6). Use a for loop to print the object (Line 8-10). The sample output is as follows:

Question: What is highest mountain?

Answer: Everest

Question: What is natural satelite of earth?

Answer: Moon

Question: Who is the first president of US?

Answer: George Washington

6 0
4 years ago
The Android operating system was invented by ______.
EleoNora [17]

The Android operating system was invented by <u>google</u> in 2005.

4 0
3 years ago
Show the dynamic and speculation execution for the following code
djyliett [7]

Answerf9,f10,fll

Explanation:

6 0
3 years ago
Other questions:
  • Specification of database requirements falls under which category of database​ administration?
    8·1 answer
  • Word, by default, places a tab stop at every ____ mark on the ruler.
    6·1 answer
  • What is the Documenter?
    10·1 answer
  • Sandra wants to have her new technology up and running as soon as possible. She is looking for a tool that she can
    8·1 answer
  • Two DHCP servers, Server1 and Server2, are running Windows Server 2016. As the administrator, you create a scope called Scope1.
    8·1 answer
  • Which is a benefit of getting information from a government website?
    15·2 answers
  • Which statement about technology before the invention of the printing press is true?
    8·1 answer
  • What is the easiest way to defeat ganon in BOTW?
    11·2 answers
  • Text me on instagram forever.brazy so we can watch a movie​
    15·1 answer
  • Reflection image and design
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!