answer.
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
Lerok [7]
2 years ago
6

zybooks cis 110 challenge activity 9.8.1 Write a program that takes in a positive integer as input, and outputs a string of 1's

and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the 0's and 1's in reverse order. Ex: If the input is 6, the output is 011. Your program should define and call a function: Function Integer To Binary(integer num) returns nothing The function should output 1's and 0's representing the integer in binary (in reverse).
Computers and Technology
1 answer:
irakobra [83]2 years ago
7 0

Answer:

public class IntegerToBinary

{

public static void main(String[] args) {

 integerToBinary(6);

}

public static void integerToBinary(int num){

    while(num > 0){

       System.out.print(num%2);

       num = Math.floorDiv(num, 2);

    }

}

}

Explanation:

*The code is in Java.

Create a function called integerToBinary that takes one parameter, num

Inside the function, create a while loop that iterates while the num is greater than 0. Inside the loop, print the num%2. Then, get the floor division of the num by to and assign it to the num.

Inside the main, call the function with parameter 6.

You might be interested in
Consider a router that interconnects three subnets: subnet 1, subnet 2, and subnet 3. suppose all of the interfaces in each of t
creativ13 [48]

Answer:

thank God for us you and keep hoping tougher than I thought it would be

4 0
2 years ago
Read 2 more answers
The domains of the risk IT framework mutually inform each other, creating flexibility and agility. It is possible to uncover a p
Andrej [43]

Answer:

The best option is A).True

Explanation:

This is because, according to the statement, it is possible to uncover a potential threat in the risk governance domain and quickly assess its impact using the risk evaluation domain in an IT environment. The risk IT framework is used in an IT environment for security of domains, the business involved, etc.

6 0
2 years ago
In cell M2, enter a formula using a nested IF function as follows to determine first if a student has already been elected to of
aleksley [76]

Answer:

Following are the code to this question:

code:

=IF(EXACT(I2,"Yes"),"Elected",IF(EXACT(K2,"Yes"),"Yes","No"))

Explanation:

In the given the data is not defined so we explain only  the above code, but before that, we briefly define working of if the function that can be defined as follows:

  • The If() function, is used only when one of the logical functions and its value must return the value true. or we can say it only return a true value.
  • In the above function, a column "Elected" is used that uses other column values to check this column value is equal if this condition is true it will return "yes" value.

8 0
2 years ago
What is one effective way for employees to keep their skillsets current?
lys-0071 [83]
They are probably looking for B.  subscribing to journals is a good way of keeping up with what's happening in any field.

Of course, a very carefully curated professional network online is great for this too (but they said "personal" so that's not the answer)

Employers generally prefer that employees WORK as often as possible, so even though JUDICIOUS use of social media is a great way to keep current, D isn't the answer either.

Blogging about personal experiences is not necessarily going to teach you anything about work, though blogging professionally can be useful in gathering response from your readership
4 0
2 years ago
Read 2 more answers
Define a function ComputeGasVolume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the g
lara [203]

Answer:

double ComputeGasVolume(double pressure, double temperature, double moles){

   double volume = moles*GAS_CONST*temperature/pressure;

    return volume;        

}

Explanation:

You may insert this function just before your main function.

Create a function called ComputeGasVolume that takes three parameters, pressure, temperature, and moles

Using the given formula, PV = nRT, calculate the volume (V = nRT/P), and return it.

6 0
2 years ago
Other questions:
  • Which of the following statements about crane hand signal training are true? A. Both statements are true about crane hand signal
    5·1 answer
  • Mr. Cooper would like to customize his Excel software so his students can create an electronic graph in Excel for their lab repo
    6·1 answer
  • Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
    15·1 answer
  • A database design where certain data entities are combined, summary totals are carried in the data records rather than calculate
    5·1 answer
  • Write a program that defines a type for a structure that stores information on a student in ENG EK 125. Declare two variables to
    8·1 answer
  • In a case where electrical current leakage from the circuit occurs, the GFCI would do the following:
    10·1 answer
  • Using basic programming (for loops, while loops, and if statements), write two MATLAB functions, both taking as input:
    6·1 answer
  • You decide to buy some stocks for a certain price and then sell them at anotherprice. Write a program that determines whether or
    11·1 answer
  • Write a method that accepts a String object as an argument and displays its contents backward. For instance, if the string argum
    10·1 answer
  • Write a multithreaded program that generates the Fibonacci series using Pthreads thread library. This program should work as fol
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!