Convert a base-10 number to a base-2 number

Assignment Help Computer Engineering
Reference no: EM132200533

Write a Java or C/C++ program to convert a base-10 number to a base-2 number. The following input should be tested:

Logic should split the number into integer and float then divide by 2 for the int concatenating into a string of 10000000 with the final remainder being 1 concatenated to the front.

The float would be multiplied by 2 then 1 would be subtracted until you get 0. The two strings would be concatenated at the end to form something like 10000.000001.

1) 12

2) 12.6875

3) .6875

Reference no: EM132200533

Questions Cloud

What you have learned about enterprise resource planning : Review what you have learned about enterprise resource planning (ERP) from the textbook and from the unit's study guide.
Define what kinds of cognitive errors contributed : Explain why Mattel's managers were able to slowly change decision making over time and what kinds of cognitive errors contributed.
Draft a preliminary description of the problem : Review the case study Maruti suzuki India: Defending Market leadership in the A-Segment and identify a problem that can be addressed by a research report.
Compare global workers and third-country nationals : Compare and contrast global workers, expatriates, local nationals, and third-country nationals. What impact, if any, do they have on international pay systems?
Convert a base-10 number to a base-2 number : Write a Java or C/C++ program to convert a base-10 number to a base-2 number.
Write a java method to take a positive integer value : Write a java method to take a positive integer value as its parameter and returns a string of 1s and 0s that represents its binary value.
What do you notice about the percentages : Write a java program that allows user to enter the number of numbers to generate random integers between 0 to 9 and displays the count of each numbers.
Write a java implementation for the following problem : Write a Java implementation for the following problem. You can make use of whichever of the ADTs Stack, Queue, and Deque that you need.
Comment your code and use procedural decomposition : Write a Java program that asks the user for a EAN13 and validates it as either correct or incorrect (display a message accordingly).

Reviews

Write a Review

Computer Engineering Questions & Answers

  Prove that your algorithm is correct or not

You are going on a trip from Halifax to San Francisco. You know that, along the route, there are gas stations at kilometers k 1, k 2, . . . , k n.

  Define your ideal home network configuration in detail

explain your ideal home network configuration in detail. In this description, include the costs of all components such as routers, computers, printers, and back-up drives.

  Prove the following property of boolean algebra

prove the following property of Boolean algebra . give a reason for each step !!

  How important is it to keep the site current

How important is it to keep the site current.According to "Putting Business Online Isn't Always Easy" (2005), "the biggest mistake people make is failing to know the commitment a Web site demands."

  Which will create a lookup field

Which of the following will create a lookup field, populate the values in the field, and establish relationships between tables?

  Create component classes as necessary to use together

Use either the array template created in an earlier lab to handle the array or you may use the vector class from the STL to handle the array of student record objects.

  Suppose that you are a cio of a startup company the company

imagine you are starting a web business and want to incorporate cloud technology. describe how you would

  Why is it that virtual memory paging does not suffer

Why is it that virtual memory paging does not suffer from external fragmentation and virtual memory segmentation does not suffer from internal fragmentation?

  Define an example of a one-to-one relationship

Look for an example of a one-to-one relationship, an instance of a one-to-many relationship, and an example of a many-to-many relationship in a newspaper, magazine, book, or everyday situation you encounter.

  Write a program to add and multiply mod n

Write a C++ computer program to add and multiply mod n, for any n given as input.

  Why do j menu objects not generate action events

Why do J Menu objects not generate action events? Can you add a menu item directly to the menu bar? Try it out. What happens?

  Would it be possible to hide data in the lt bits of each

Would it be possible to hide data in the lt bits of each pixel of a JPEG image by converting it to an array of RGB pixel values, changing the pixel values.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd