User Profile

Collapse

Profile Sidebar

Collapse
tiktik
tiktik
Last Activity: Dec 17 '09, 10:20 PM
Joined: Nov 21 '08
Location: Nadur, Gozo, Malta
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • tiktik
    replied to Embedding music in Java
    in Java
    Thanks, I done just that, and the resource file is indeed getting accessed now... however still no music comes out. I find it very strange seeing that the sound file is being accessed, yet still no sound is heard. Is the Windows Media Player supposed to open upon access of the resource file?

    thanks a lot,
    tiktik...
    See more | Go to post

    Leave a comment:


  • tiktik
    replied to Embedding music in Java
    in Java
    Thanks a lot,

    I've found an example as well an did this program, however there is one problem.

    Code:
    import java.applet.Applet;
    import java.applet.AudioClip;
    import java.net.URL;
    
    public class Music_1 {
      public static void main(String[] args) {
        try {
          URL url = new URL("file:Zocalo.wav");
          AudioClip ac = Applet.newAudioClip(url);
    ...
    See more | Go to post

    Leave a comment:


  • tiktik
    started a topic Embedding music in Java
    in Java

    Embedding music in Java

    Hey there,

    I was doing a simple program using JCreator where I wanted to embed a song. However I don't know how I can do this, and although I browsed thoroughly through the web, I did not find any examples on how one can embed some music in his program...

    Any idea on how I can embed a song from My Documents (or elsewhere) into my program?

    Any help would be much appreciated.

    Regards,...
    See more | Go to post

  • tiktik
    started a topic Clearing the screen
    in Java

    Clearing the screen

    Hey there...

    I know that Java does not have a specific command which clears the screen, however I was wondering whether there exists some simple commands/coding which would have the same result.

    any ideas pls?
    See more | Go to post

  • tiktik
    replied to Help making a hangman program
    in Java
    hangman

    hi there...

    Last year, I did the whole hangman game in Pascal; however it was a little bit different in structure than yours is going to be; in such a way that mine first involved the first player to enter the "Secret_wor d", and then the second player would try to guess it. With regards to the blanks, an int variable "no_of_blan ks" would read the length of the "Secret_wor d" entered...
    See more | Go to post

    Leave a comment:


  • tiktik
    replied to Conditional branching problem
    in Java
    problem solved =)

    thanks
    See more | Go to post

    Leave a comment:


  • tiktik
    started a topic Conditional branching problem
    in Java

    Conditional branching problem

    Hi all...

    I am compiling this simple program which determines the ticket price for the person, depending on the criteria entered.

    My problem is, however, that the answer at the end is always "FREE" (as if the program is not considering the other if branches =(

    Code:
    System.out.println("Enter your age ");
        	    	int age = Keyboard.readInt();
        	    	
        	    	System.out.println("Enter
    ...
    See more | Go to post

  • tiktik
    replied to Nested if() statements...Grade range...
    in Java
    Thanks for the detailed explanation.
    good comic as well =)

    tiktik
    See more | Go to post

    Leave a comment:


  • tiktik
    replied to Nested if() statements...Grade range...
    in Java
    Yes, thanks for your reply...it works very well with it as well

    Any idea about the break; question?
    See more | Go to post

    Leave a comment:


  • tiktik
    replied to Nested if() statements...Grade range...
    in Java
    Never mind.... i solved the problem by inserting "System.out.pri ntln" after every if statement like this

    Code:
     public static void main(String[] args) {
        
        System.out.print ("Enter mark: ");
    	int mark = Keyboard.readInt();
    	char grade =' ';
    		
    	
    	if (mark > 100) System.out.println ("Invalid Entry"); 
    	   else if (mark >=80 && mark
    ...
    See more | Go to post

    Leave a comment:


  • tiktik
    replied to Nested if() statements...Grade range...
    in Java
    Yes that's it thanks a lot...

    but now i have another problem...

    i would like that if the entry is invalid, it would not display the last line ("Grade =" ), and so i tried to insert the 'break;' but it seems as if it can be used only in loops or switch :(



    Code:
     public static void main(String[] args) {
        
        System.out.print ("Enter mark: ");
    ...
    See more | Go to post

    Leave a comment:


  • tiktik
    started a topic Nested if() statements...Grade range...
    in Java

    Nested if() statements...Grade range...

    Hi...

    I am doing this simple Java program which displays a particular grade (A, B, C...) according to the mark entered.

    However I cannot arrange it in such a way that it displays "Invalid" if the user eners a grade > 100... take a look...


    Code:
    System.out.print ("Enter mark: ");
    	int mark = Keyboard.readInt();
    	char grade =' ';
    		
    	
    	if (mark
    ...
    See more | Go to post

  • tiktik
    replied to Generating Random Numbers
    in Java
    Thanks a lot ... i think i've found it :

    int a = (int) (Math.random()* 20) +70;

    isn't it?...
    (it does work)

    thanks again =)...
    See more | Go to post

    Leave a comment:


  • tiktik
    started a topic Generating Random Numbers
    in Java

    Generating Random Numbers

    Hey,
    I had school exercise in which i needed to generate some numbers within the range of 70 to 90. I'd like to know whether there exists an exact formula which allows the numbers to be generated within a particular range.


    When I had to generate numbers from 10 to 20, the correct code was :

    float a = (float) (Math.random()* 10) +10;

    but I can't establish a general rule for all the ranges......
    See more | Go to post
No activity results to display
Show More
Working...