Hello, this my first thread and I need some supper fast help I'm on a deadline...
I have applied for a Microsoft program but part of the application process is to complete this assignment...
You are to create a console application that accepts exactly one command-line argument. If it doesn’t receive the argument, the application must display an error message and exit. The application must parse the text input and output the number of times each letter of the alphabet occurs in the text. Case sensitivity is not required.
For example, if the command-line argument is “baaad” the displayed result must be:
There are 3 A's
There are 1 B's
There are 0 C's
There are 1 D's
There are 0 E's
There are 0 F's
etc...
I've gotten this so far...
<html>
<head>
<script type="text/javascript">
function count_char($str,1)
{
return ("count_char($str,1);
}
<?php
$str = "Hello World!";
print_r(count_chars($str,1));
?>
public class CountWordLetters {
public static void main(String[] args) {
String InputWord = JOptionPane.showInputDialog("Please enter a string: ");
int len = InputWord.length();
char[] tempCharArray = new char[len];
char[] charArray = new char[len];
for (int i = 0; i < len; i++) {
tempCharArray[i] = InputWord.charAt(i);
}
</script>
</head>
<script type="text/javascript">
echo(count_chars($str,1))
</script>
<body>
<form>
<input type="text" value="Please enter string" />
<input type="button" value="Click me!" onclick="count_chars($str,1))" />
</form>
<p>By clicking the button above the letters in the string will be counted and displayed</p>
</body>
</html>
But I know for sure I messed something up/left something out because whenever I try to run the code, clicking the button doesn't do anything, Please Help Me!!!
I started learning from w3schools.com but they don't tell you exactly how to assemble the Java Script code I have until 6/25/10 to submit my code to my application overseer.