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
trapecia [35]
2 years ago
8

Consider the classes below: public class TestA { public static void main(String[] args) { int x = 2; int y = 20 int counter = 0;

for (int j = y % x; j < 100; j += (y / x)) { counter++; } } } public class TestB { public static void main(String[] args) { int counter = 0; for (int j = 10; j > 0; --j) { ++counter; } } }
Computers and Technology
1 answer:
Natali5045456 [20]2 years ago
8 0

Answer:

Option d (neither a or b is true) is the correct answer for the above question.

Explanation:

Missing information : The options and the main question (which is true from the following) is not mentioned in the above question.

There is a two program given in the above question and asked to justify the true statement. The options descriptions are as follows:-

  • Option a states that the value of a counter variable will not be the same for both the program, which is not correct because both program loop will be executed 10 times only and the value of the counter will also be 10.
  • Option b states that the value of j will not be different for both the program which is also not correct because the first program loop will process from 10 to 1 by the difference of 1 but the second for loop will execute for i value from 0 to 90 by the difference of 10.
  • Option c states to right for both the option which is not correct.
  • Option d states to wrong for both the correct option. Hence option d is the correct answer.
You might be interested in
write a function that given an integer n returns the smallest integer greater than n the sume of whose digits is twice as big th
USPshnik [31]

The code below is written in javascript which gives us the integer,

<h3>The function code is</h3>

function solution (num){


//Javascript function


var x=0,sum=0,a,b;


var d=""; //variable declaration


var digits = num.toString().split('');


var Individual = digits.map(Number);


//console.log(Individual);


for (var i=0;i<Individual.length;i++)


{//For loop


x=x+Individual[i];


}


var y=x*2;


for(var i=0;i<Individual.length;i++)


{


sum=sum+Individual[i];


d=""+d+Individual[i];


if(sum==y)


break;


if(i==Individual.length-1)


{


i=-1;


continue;


}


}


console.log("the value is "+d);


}


var number = prompt("enter the number");


//Asking user for value...


console.log("the number is");


console.log(number);


solution(num

For more information on javascript, visit

brainly.com/question/16698901?referrer=searchResults

3 0
2 years ago
The Department Manager researches new data platforms for the company and requests a list of essential features. Which essential
Ipatiy [6.2K]

Answer:

Centralisation

dashboard , programmatic access

Explanation:

hope it helps u

mark me as brainlist

4 0
3 years ago
1. Write a function that will ask the user to enter a value in dollars. The function should calculate and display the equivalent
julia-pushkina [17]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    valueInDollars();

}

   public static void valueInDollars() {

       double currentMoney, quarters, dimes, nickels, pennies;

       Scanner input = new Scanner(System.in);

       

       System.out.print("Enter a value in dollars: ");

       currentMoney = input.nextDouble();

       currentMoney *= 100;

       quarters = (int)currentMoney / 25;

       currentMoney = currentMoney % 25;

       

       dimes = (int)currentMoney / 10;

       currentMoney = currentMoney % 10;

       

       nickels = (int)currentMoney / 5;

       currentMoney = currentMoney % 5;

       

       pennies = currentMoney;

       

       System.out.print("Quarters: " + quarters + "\n" + "Dimes: " + dimes + "\n" + "Nickels: " + nickels + "\n" + "Pennies: " + pennies);

   }

}

Explanation:

<u>Inside the function:</u>

- Declare the variables

- Ask the user for a value in dollars

- Multiply that value by 100

- Find the amount of quarters, dimes, nickels, and pennies

- Print the values

<u>Inside the main:</u>

- Call the function

3 0
3 years ago
How to make a water bottle rocket??
k0ka [10]
This question should be in physics so this is my answer in C&T format-go to a online shop and order one or the pieces then follow the instructions that will be given.
6 0
3 years ago
DDL statement for adding a column to an existing table is
vaieri [72.5K]

Answer:to add a column to existing table.

to rename any existing column.

to change datatype of any column or to modify its size.

to drop a column from the table.

Explanation:

hope this help

4 0
2 years ago
Other questions:
  • What is a geotag?
    10·1 answer
  • HELP AS SOON IS A UNIT TEST WILL GIVE BRAINLIEST
    9·2 answers
  • What standard linux utility is used to install and configure software on centos operating systems?
    8·1 answer
  • Jana keeps receiving friend requests from strangers on a social media site. This is making her uncomfortable.
    15·2 answers
  • What runs horizontally and is identified with numbers?
    12·2 answers
  • Which of the following software maintenance steps erases gaps caused by deleting files from the hard drive?
    10·1 answer
  • A circuit breaker will do which of the following
    12·1 answer
  • Which command do you use to save a document with a new name? Choose the answer.
    10·2 answers
  • What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
    13·1 answer
  • What does the word collaborative mean?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!