Answer:
c. parameters
Explanation:
Parameters are simply placeholders (sometimes called dummy variables) used mainly by methods to perform their given tasks so as to provide controlled variability in the program(or algorithm). Sometimes they are called arguments. But then it is much more specific to simply use parameters rather than arguments because arguments are the variable values that the parameters are serving as placeholders for.
Parameters identify and describe values that are passed into a function or subroutine.
Parameters are also used for simulation and testing purposes where the input s to the program are or can be varied.
PS: Methods are just functions performed by a class in a program.
Puedes crear videos y presentaciones
The correct answer is D all of the above
Answer:
cant really see but, it looks like post Malone??
Explanation:
Answer:
- import java.util.Scanner;
- public class Main {
-
- public static void main(String[] args) {
-
- Scanner input = new Scanner(System.in);
- int firstNum, secondNum;
-
- do{
- System.out.print("Input first number: ");
- firstNum = input.nextInt();
- System.out.print("Input second number: ");
- secondNum = input.nextInt();
-
- for(int i= firstNum; i <= secondNum; i++){
- if(i % 2== 1){
- System.out.print(i + " ");
- }
- }
-
- System.out.println();
-
- int evenSum = 0;
- for(int i= firstNum; i <= secondNum; i++){
- if(i % 2== 0){
- System.out.print(i + " ");
- evenSum += i;
- }
- }
-
- System.out.println();
- System.out.println("Sum of even: " + evenSum);
- System.out.println();
-
- int squareOddSum = 0;
- for(int i= firstNum; i <= secondNum; i++){
- System.out.println(i + " : " + (i*i) );
- if(i % 2 ==1){
- squareOddSum += i;
- }
- }
- System.out.println();
- System.out.println("Sum of squared odd number: " + squareOddSum);
-
- }while(firstNum < secondNum);
- }
- }
Explanation:
The solution code is written in Java.
Firstly, we create a Scanner object (Line 6) and use it get user input for first and second number (Line 10-13). We create a for loop and use modulus to check the current number is divisible by 2 and print out the odd number in loop (Line 15-19). We repeat the similar step to print the even number but at the same time, we also add the current number to evenSum variable and print the sum after the for loop (Line 23-33).
Next, we proceed to use another for loop to print out the number and their squares and then accumulate the sum of squares of all odd numbers (Line 36-41).
At last, we print out the sum of squares of odd numbers (Line 43).
In the do while loop condition, if firstNum is smaller than secondNumber, the loop is ongoing (Line 45).