Question

string hex = String.Format("{0:X}", dec); this line is in c# how to translate this line to...

string hex = String.Format("{0:X}", dec);

this line is in c# how to translate this line to c++ or java

0 0
Add a comment Improve this question Transcribed image text
Answer #1

String hex = String.format("%X", dec);
Add a comment
Know the answer?
Add Answer to:
string hex = String.Format("{0:X}", dec); this line is in c# how to translate this line to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • else if (line.Contains(",")) { string code = line; string val = ""; for (int i = 9; i &lt...

    else if (line.Contains(",")) { string code = line; string val = ""; for (int i = 9; i < code.Length; i++) val += code[i]; int v; if (val.Contains("-")) v = Convert.ToInt32(val) * (-1); else v = Convert.ToInt32(val); String baze = code.Substring(5, 3); objFile.WriteLine(String.Format("{0:X}", lc) + "\t" + getBinary(baze, v, !code.Contains("-"))); lc++; how to translate this to Java getBinary is a function implemented in my project

  • Hex nuts A and C are tied to a string at its two free ends and...

    Hex nuts A and C are tied to a string at its two free ends and hex nut B is tied between the two. The string is held vertically over a pan with nut A closest to the pan.After the string is released onto the pan, the second clang is heard 0.5 seconds after the first clang and third clang is heard 0.5 seconds after the second clang. From this, one can conclude that Select one: a. distance AB< distance...

  • Arduino. DEC HEX BIN(4-bits) Introducing ARDUINO 0 0 0000 1 1 0001 2 2 0010 3...

    Arduino. DEC HEX BIN(4-bits) Introducing ARDUINO 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 How many 1/0 of Port-D? How many usable 1/0 of Port-D, if Serial-Communication is in-used? What is the Arduino's pin assignment of ATMEL's PC5, PB3, & PD1*? What is the ATMEL's pin assignment of Arduino's D13*, D1, & D19? To complete the table about Number System Conversion (shown your step) 6 6 0110 7 7 0111...

  • Can you please translate this code from Java to C++; These are the only libraries i...

    Can you please translate this code from Java to C++; These are the only libraries i am allowed to use #include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <string> using namespace std; 1 /* Given a string, compute recursively (no loops) a new string where all * appearances of "pi" have been replaced by "3.14". public String changepi(String str) { if(str.length() <= 1) return str; if(str.substring(0, 2).equals("pi")) return "3.14" + changepi(str.substring(2)); 11 12 return str.charAt(0) + changepi(str.substring(1)); }

  • Using C++ Design a class called Numbers that can be used to translate integers in the range 0 to ...

    Using C++ Design a class called Numbers that can be used to translate integers in the range 0 to 9999 into an English description of the number. The class should have a single integer member variable: int number; and a static array of string objects that specify how to translate the number into the desired format. For example, you might use static string arrays such as: string lessThan20[20] = {"zero", "one", ..., "eighteen", "nineteen"}; string hundred = "hundred"; string thousand...

  • Convert Hex To Dec in java with HashMap and put in .txt file I'm making a...

    Convert Hex To Dec in java with HashMap and put in .txt file I'm making a compiler for assembler in JAVA. My program after several processes leaves a text file as follows. 02TLIGHT2.ASM file with this: CLO Start: MOV AL,0 OUT 01 MOV AL,FC OUT 01 JMP Start END Im trying by means of my hashmap convert the commands to his assigned hexadecimal value and put it in a text file? The output of my actual program in a 02TLIGHTHexa.ASM...

  • In Python, revise this code. define convert(s): """ Takes a hex string as input. Returns decimal...

    In Python, revise this code. define convert(s): """ Takes a hex string as input. Returns decimal equivalent. """ total = 0 for c in s total = total * 16 ascii = ord(c if ord('0) <= ascii <= ord('9'): #It's a decimal number, and return it as decimal: total = total+ascii - ord('0') elif ord('A") <= ascii <= ord('F'): #It's a hex number between 10 and 15, convert and return: total = total + ascii - ord('A') + 10 else...

  • 1) Which sed command line string will delete any line that begins with the string 'directory'...

    1) Which sed command line string will delete any line that begins with the string 'directory' within the file called sedfile. A) sed '/dir/d' sedfile B) sed '/^dir/d' sedfile C) sed 's/^dir/d' sedfile D) sed '/directory/d' sedfile 2) Complete the sed commmand string below. Create a sed command line string that will replace ALL the occurrences of X and x with s within the file called sedfile. sed 's/##/s/g' sedfile Replace the ## with the BEST correct answer. A) [X,x]...

  • Given a String str, and a char c return the number of times that c appears...

    Given a String str, and a char c return the number of times that c appears inside str. countChar("Abcdefg", 'a') returns 1 countChar("xxXx", 'x') returns 4 countChar("", 'q'') returns 0 ----------------- Please use java public class Count { public int countProblem(String str, char c) { int res = 0; //Your work is here return result; } }

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT