Concept explainers
Display a given a decimal value in every base from 2 (binary) through 16 (hexadecimal).
Input Format
You will be given a single positive whole decimal number.
Constraints
The number will be between 2 and 2^63-1 (Long.MAX_VALUE)
Output Format
output 15 lines.
One line for each base from 2 through 16.
On each line print the number in base 10 and it's equivalent representation in the base for the line.
Note: the examples will show your output format.
Sample Input 0
Sample Output 0
Explanation 0
Check with the programmer version of your calculator - The mode that shows the value in several bases.
Note that each line of the output is an english sentence ending with a period. Match the output.
Sample Input 1
Sample Output 1
Explanation 1
Note there are no indicators in your output value as to what the base is.
i.e. We output 3F for 63 in base 16. You may have seen a typical notation of 0x3Fh or something similar
Also note that the hexadecimal digits (A-F) are UPPERCASE
I need code in java
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
- HW6_4: Write code to solve the following system of equations using the Newton-Raphson method. Let x = 1, y = 1, z = 1 for starting guesses and determine the solution to 4 sig figs. Display the final answers on screen using an fprintf statement. f(x,y,z) = x³ – 10x + y – z = -3 g(x, y, z) = y3 + 10y – 2x – 2z = 5 h(x,y, z) = x + y – 10z + 2 sin(z) = -5arrow_forwardPlease design another function called: multiply_up (int n), which will multiple up from 1 to n, like 1*2*3*4*5....*n, and return the result.arrow_forwardQ1: complete the function that will return the multipication of 3 given numbers - a,b,c. In [ ]: def multiply_numbers(a,b,c): II II || """insert the code that performs the operation. Use the variable 'number' to hold and return the value II || || # your code here return numberarrow_forward
- Insert these values 8, 35 and 99 (in this order) in the given BST. Show the final BST after inserting those three items. Draw the new BST with the new items added. / 30 64 1 75 / \/ \ 10 40 70 80 // \ \ 38 68 73 90 Answer:arrow_forwardAdd remain code and complete. number is a number whose sum total of the factorials of each digit is equal to thenumber itself. The following are some examples of Krishnamurthy numbers: "145" is a Krishnamurthy Number because,1! + 4! + 5! = 1 + 24 + 120 = 145 "40585" is also a Krishnamurthy Number.4! + 0! + 5! + 8! + 5! = 40585 "357" or "25965" is NOT a Krishnamurthy Number3! + 5! + 7! = 6 + 120 + 5040 != 357 The following function will check if a number is a Krishnamurthy Number or not and return aboolean value.""" def find_factorial(n): """ Calculates the factorial of a given number n """ fact = 1 while n != 0: fact *= n n -= 1 return fact def krishnamurthy_number(n): if n == 0: return False sum_of_digits = 0 # will hold sum of FACTORIAL of digits temp = n.arrow_forwardEnter a formula in cell H5 that divides the sum of cells C5:F5 by cell B5. Write the formulausing an absolute cell reference so that when you copy the formula to cells H6 and H7, cell B5remains absolute.arrow_forward
- Complete the Funnyville High School registration program where user is prompted for her full name and the program generates email id and temporary password. Sample run: generate_EmailID: This function takes two arguments: the user’s first name and last name and creates and returns the email id as a string by using these rules: The email id is all lower case. email id is of the form “last.first@fhs.edu”. e.g. For "John Doe" it will be "doe.john@fhs.edu". See sample runs above. generate_Password: This function takes two arguments: the user’s first name and last name and generates and returns a temporary password as a string by using these rules. Assume that user's first and last names have at least 2 letters. The temporary password starts with the first 2 letters of the first name, made lower case. followed by a number which is the sum of the lengths of the first and last name (For example this number will be 7 for "John Doe" since length of "John" is 4 and length of "Doe" is…arrow_forwardAC that adds two very large integers entered by the user on the keyboard write the program. Very large integers represent standard data types (long int, double, etc.) you cannot collect it using. Reading and adding numbers from the keyboard as a string As you learned the process in elementary school, starting from the units digit, you can add the mutual numbers one by one. you must realize by collecting. The numbers that the user has entered into a different number of digits. In order to have it, your program should work. The output of your program is the example below should be compatible with the program outputs. In the program output, as in the addition operation the numbers and the total should be written one under the other, with the mutual digits aligned. Sample program output - 1: First number: 111111111111111111111111 Second number: 999999999 11111111111u111. 9999999999 1111111111111120000000000 Sample program output - 2: First number: 11 Second number:…arrow_forwardBinary – Decimal – Hex Converter: Create a program that will take any number in either decimal, binary or hexadecimal and convert it to the remaining two of the three given numeral systems. Use the process outlined in the slides to determine the conversion. You cannot use the int() function to convert the numbers.arrow_forward
- An integer n is passed as argument to a function named convert0to5. This function returns an integer by replacing all 0's in the number by 5. Note: Do not convert the number to string.arrow_forward1. Create a vector of the even whole numbers between 32 and 75 in Scilab Code.arrow_forwardplease code in pythonis_phone_num: This Boolean function takes a string and returns True if it is in the formatddd-ddd-dddd, where d is a digit, False otherwise. Example calls:is_phone_num('123-456-7890') --> Trueis_phone_num('123-4556-7890') --> Falseis_phone_num('(123)456-7890') --> Falsearrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education