Ask Question
22 March, 20:56

Write code to read a list of song names and durations from input. Input first receives a song name, then the duration of that song. Input example: Time 424 Money 383 quit.

+5
Answers (1)
  1. 22 March, 21:03
    0
    public class SongList

    {

    public static void main (String [] args)

    {

    scanner input = new Scanner (System. in)

    System. out. Println ("Do you want to run again:/n (1 for yes and 2 for no ")

    Int run = in. nextInt

    Do

    {

    System. out. Println ("Enter song name:/n ")

    String songName = in. nextString;

    System. out. Println ("Enter song duration:/n ")

    String songDuration = in. nextString;

    }

    while (run = = 1)

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write code to read a list of song names and durations from input. Input first receives a song name, then the duration of that song. Input ...” in 📙 Engineering if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers