Convert this Java class to C++ 17

In Progress Posted 4 years ago Paid on delivery
In Progress Paid on delivery

I need this class converted to c++

The purpose of this class is to input a number and get the names

i.e 1000 = 1k, 1100 = 1.1k, 100000 = 100k, 1000000 = 1m 1100000 1.1m and so on

public class NumberNames {

private static final String[] NAMES = new String[]{

"K",

"M",

"B",

"T",

"Quadrillion",

"Quintillion",

"Sextillion",

"Septillion",

"Octillion",

"Nonillion",

"Decillion",

"Undecillion",

"Duodecillion",

"Tredecillion",

"Quattuordecillion",

"Quindecillion",

"Sexdecillion",

"Septendecillion",

"Octodecillion",

"Novemdecillion",

"Vigintillion",

};

private static final double THOUSAND = 1000;

private static final NavigableMap<Double, String> MAP;

static {

MAP = new TreeMap<>();

for (int i = 0; i < [login to view URL]; i++) {

[login to view URL]([login to view URL](THOUSAND, i + 1), NAMES[i]);

}

}

public static String createString(Double number) {

if(number == null) {

number = 0.0;

}

[login to view URL]<Double, String> entry = [login to view URL](number);

if (entry == null) {

return [login to view URL]();

}

double key = [login to view URL]();

double d = key / THOUSAND;

Double m = number / d;

float f = [login to view URL]() / 1000.0f;

float rounded = ((int) (f * 100.0)) / 100.0f;

if (rounded % 1 == 0) {

return ((int) rounded) + " " + [login to view URL]();

}

return rounded + " " + [login to view URL]();

}

}

Java C++ Programming

Project ID: #22796779

About the project

10 proposals Remote project Active 4 years ago

10 freelancers are bidding on average £21 for this job

valor312

VERY EASY FOR ME As you can see in my review, I've done similar with yours Hello. I have read your description and I am so interested in your project. I am confident in your project and I can finish it clearly on time More

£20 GBP in 1 day
(91 Reviews)
6.4
corke123

Hi. I would like to do this project for you. I am quite good with both, Java and C++ and I can do this quickly. Message me to discuss more details about your project

£18 GBP in 1 day
(74 Reviews)
5.7
Ahmed818

Hello, ⭐⭐⭐⭐⭐ i am interested in this project , i can convert this class to c++ easily can begin now waiting your answer on chat Regards ⭐⭐⭐⭐⭐

£15 GBP in 1 day
(20 Reviews)
4.1
FreeXXM

Hello! I saw your project details and very interested in it. I have rich experience in developing C/C++, JAVA programs for +8 years. If you hire me, you will receive satisfied result. I can work right now and full time More

£20 GBP in 1 day
(3 Reviews)
3.4
arjun366333

Hello, I'm interested in your project. Please send me a message so that we can discuss more. I prefer to submit my detailed proposal after our discussion. Note: + We are flexible with changes. + [login to view URL] More

£50 GBP in 7 days
(6 Reviews)
3.7
kyj629

Hi! Nice to meet you. My name is Nemanja, c expert from Russia. I have read your project detail carefully. I have about 10 years of experience. I can complete your job within a few hours. please contact me so that we More

£20 GBP in 1 day
(3 Reviews)
2.0
nyxhrim

Hi I can do it for you it is quite simple, send me a private message and we can discuss the details

£20 GBP in 7 days
(2 Reviews)
1.5
k1mnicol

Hello. I have just reviewed your job description carefully. I'm a skillful C/C++ developer. I'll be great for an interview and can offer better estimate of time frames and costs. I assure that you will get high quali More

£15 GBP in 7 days
(1 Review)
1.4
billion4world1

Dear Client, How are you doing?. I have read the description, I have great experience doing similar jobs related to these skills Algorithm,java,C# Programming, C++ Programming, FIX API, Software Architecture. Right no More

£20 GBP in 1 day
(0 Reviews)
0.0