Ask Question
24 January, 06:34

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.

+2
Answers (1)
  1. 24 January, 06:58
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers