1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kazeer [188]
4 years ago
9

CHANGE POSITION OF SONG Enter song's current position: Enter new position for song: "Peg" moved to position 3 JAMZ PLAYLIST MENU

a - Add song r - Remove song c - Change position of song s - Output songs by specific artist t - Output total time of playlist (in seconds) o - Output full playlist q - Quit Choose an option: JAMZ - OUTPUT FULL PLAYLIST
1. Unique ID: JJ234 Song Name: All For You Artist Name: Janet Jackson Song Length (in seconds): 391
2. Unique ID: J345 Song Name: Canned Heat Artist Name: Jamiroquai Song Length (in seconds): 330
3. Unique ID: SD123 Song Name: Peg Artist Name: Steely Dan Song Length (in seconds): 237
4. Unique ID: JJ456 Song Name: Black Eagle Artist Name: Janet Jackson Song Length (in seconds): 197
5. Unique ID: SD567 Song Name: I Got The News Artist Name: Steely Dan Song Length (in seconds): 306

JAMZ PLAYLIST MENU a - Add song r - Remove song c - Change position of song s - Output songs by specific artist t - Output total time of playlist (in seconds) o - Output full playlist q - Quit Choose an option:
Computers and Technology
1 answer:
hichkok12 [17]4 years ago
6 0

Answer:

Answers can be found below

Explanation:

port java.util.Scanner;

public class Playlist {

String title;

SongEntry head;

public Playlist(String title) {

this.title = title;

this.head = null;

}

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

System.out.println("Enter the playlist's title:");

String title = scanner.nextLine();

Playlist playList = new Playlist(title);

String option;

do {

option = playList.printMenu(scanner);

switch (option) {

case "a":

playList.addSong(scanner);

break;

case "d":

playList.removeSong(scanner);

break;

case "c":

playList.changePosition(scanner);

break;

case "s":

playList.outputSongByArtist(scanner);

break;

case "t":

playList.outpuTotalTime();

break;

case "o":

playList.outputFullPlayList();

break;

case "q":

System.out.println("QUIT");

break;

default:

System.out.println("please enter a valid option");

}

} while (!option.equals("q"));

}

public String printMenu(Scanner scanner) {

System.out.println(this.title + " PLAYLIST MENU");

System.out.println("a - Add song");

System.out.println("d - Remove song");

System.out.println("c - Change position of song");

System.out.println("s - Output songs by specific artist");

System.out.println("t - Output total time of playlist (in seconds)");

System.out.println("o - Output full playlist");

System.out.println("q - Quit");

System.out.println("Choose an option:");

String input = scanner.nextLine();

return input;

}

public void outputFullPlayList() {

if (head == null) {

System.out.println("Playlist is empty");

} else {

SongEntry tempNode = head;

while (tempNode != null) {

tempNode.printPlaylistSongs();

tempNode = tempNode.getNextNode();

}

}

}

public void addSong(Scanner scanner) {

System.out.println("ADD SONG");

System.out.println("Enter song's unique ID:");

String uniqueId = scanner.nextLine();

System.out.println("Enter song's name:");

String songName = scanner.nextLine();

System.out.println("Enter artist's name:");

String artistName = scanner.nextLine();

System.out.println("Enter song's length (in seconds):");

int length = Integer.parseInt(scanner.nextLine());

SongEntry song = new SongEntry(uniqueId, songName, artistName, length);

if (head == null) {

head = song;

} else {

SongEntry tempNode = head;

while (tempNode.getNextNode() != null) {

tempNode = tempNode.getNextNode();

}

tempNode.insertAfter(song);

}

}

public void removeSong(Scanner scanner) {

System.out.println("REMOVE SONG");

System.out.println("Enter song's unique ID:");

String uniqueId = scanner.nextLine();

SongEntry tempNode1 = head;

SongEntry tempNode2 = head;

while (tempNode1 != null) {

if (tempNode1.getUniqueID().equals(uniqueId)) {

if (tempNode1.getUniqueID().equals(head.getUniqueID())) {

You might be interested in
Please help, you don’t have to answer it i just need to know the best types of conversions
Pepsi [2]

Answer:

Purchase. The most common types of website conversions are sales. ...

Form submission. The next most common goal for a website conversion is a form submission. ...

Sign-up. ...

Clicking a button. ...

Create an account. ...

Content shares. ...

App install.

Explanation:

hope i helped you

4 0
3 years ago
A methods and measurements analyst for Digital Devices needs to develop a time standard for the task of assembling a computer mo
Karo-lina-s [1.5K]

Answer:

34 seconds

Explanation:

Contingencies are not co soldered in the observed time because the time an individual takes to college a particular task is called observed time.

As the worker takes 34 seconds minimum to complete the task so 34 seconds is the answer.

4 0
3 years ago
When both gears are the same size what will they produce
djverab [1.8K]

They produce a 1:1 ratio.  The input power is equal to the output power.

7 0
4 years ago
PLEASE HELP WILL GIVE BRAINLIEST!
fgiga [73]

Answer:

(1BD.63B851EB851EB851EB85)₁₆

Explanation:

7 0
4 years ago
Read 2 more answers
The intranet is the same as the internet. true false
galina1969 [7]
False, the intranet <span> does not refer to a network that supports communication between different organizations.</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • How does a hard drive work
    14·1 answer
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • Find all three-digit numbers with non-zero first digit that are equal to the sum of the cubes of their digits.
    8·1 answer
  • Your friends’ preschool-age daughter Madison has recently learned to spell some simple words. To help encourage this, her parent
    8·1 answer
  • Complete the crossword puzzle.
    12·2 answers
  • Mark is the network administrator in his building and is responsible for training all the new technicians on various troubleshoo
    7·1 answer
  • Write code to simulate the following differential equation for x ranging from 0 to 5. Assume y = 0 when x = 0. Plot y vs. x usin
    11·1 answer
  • The __________ utility has the capability to manage users, create and administer user groups, and apply user rights to those use
    8·1 answer
  • What intangible benefits might an organization obtain from the development of an
    5·2 answers
  • In python,
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!