|
Here is what it looks like at the begining:
/*
* Main.java
*
* Created on November 29, 2007, 6:58 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/this is just the heading i know
package javaapplication6; <--i never use packages at school
public class Main <--ahh this looks familar
{
public Main () <--dont remeber using this at school
{
}
public static void main (String[] args) <--looks familar
{
// yes i put my code here i know
}
}
THIS IS A CODE FROM MY CLASS I DID
/*
Jordan Nissley
fourteen.java
purpose-aeiou
*/
import cs1.Keyboard;
import java.lang.String;
public class fourteen
{
public static void main (String []args)
{
String str="";
int a=0, e=0, i=0, o=0, u=0, one=1, count=0, c=0, other=0;
System.out.println ("Please enter your text.");
str=Keyboard.readString();
one=str.length();
while(count<1)
{
c=str.charAt(count);
if(c!='a' && c!='e' && c!='i' && c!='o' && c!='u')
{
other+=1;
}
else
if(c=='a')
a+=1;
if(c=='e')
e+=1;
if(c=='i')
i+=1;
if(c=='o')
o+=1;
if(c=='u')
u+=1;
count++;
}
System.out.println ("Total a's: " + a);
System.out.println ("Total e's: " + e);
System.out.println ("Total i's: " + i);
System.out.println ("Total o's: " + a);
System.out.println ("Total u's: " + a);
System.out.println ("Total of other stuff: " + other);
}
}
|