Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #4K
~990 People Reached
Favorite Forums

7 Posted Topics

Member Avatar for spider_pig

I have a HashMap with String keys and Integer values. I want to get a string with the String keys in numerical order of their String values. eg. if I have Orange=1 apple=4 pear =2 grapefruit=3 I want the following String apple, pear, grapefruit, orange. I'm not sure how to …

Member Avatar for jwenting
0
69
Member Avatar for rayxu88

I've tried this and it works public class Anagram1{ private String x; private String y; private char[] xarray; //? private char[] yarray; //? public Anagram1(String phrase1, String phrase2){ x = phrase1; y = phrase2; } public void xlettersort(){ x= x.toLowerCase(); xarray = x.toCharArray(); java.util.Arrays.sort(xarray); } public void ylettersort(){ y= y.toLowerCase(); …

Member Avatar for rayxu88
0
133
Member Avatar for spider_pig

I have a Java HashMap with String keys and Integer values. I need to produce a string which has the keys in the same order as their corresponding values sorted by numerically descending order. What are my options?

Member Avatar for jwenting
0
68
Member Avatar for spider_pig

Sorry if this has been asked before but I have tried to find a solution elsewhere. I am using the getline function to receive input from the keyboard and save it in a text file. The problem is that it insists on printing a null character (the square box thingy) …

Member Avatar for dougy83
0
183
Member Avatar for kodiak

If you put [code] void setcolor(unsigned short color) { HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hcon,color); } [/code] this before the main process you can call the setcolor function before you print to the screen using numbers 0 to 15 as parameters eg [code] setcolor(3); cout << "I'm blue"; [/code] Experiment and …

Member Avatar for spider_pig
0
330
Member Avatar for rainbow78

Your code is some way short of a working solution. I don't think you need a for loop in the main function, probably a loop is needed in the data entry function. It is not clear whether there is a set number of names to be entered or if the …

Member Avatar for spider_pig
0
108
Member Avatar for spider_pig

Supposing I have a class Dog with attributes age and color. I also have a function print(string) which invokes the accessor functions for the dog attributes. Now when the user enters the name of a Dog object at the command line I would like to call the print function to …

Member Avatar for ShawnCplus
0
99

The End.