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]
3 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]3 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
A ____ is a type of program that uses a grid to organize and work with data.
VLD [36.1K]

Question: A ____ is a type of program that uses a grid to organize and work with data.

Answer: cells

Explanation: cells store data and other things in columns and organize them


Question: Explain how to create a Pivot table?

Answer:  1.Click a cell in the source data or table range.

2.Go to Insert > Recommended PivotTable.

3.Excel analyzes your data and presents you with several options, like in this example using the household expense data.

4.Select the PivotTable that looks best to you and press OK.

question answered by

(jacemorris04)

4 0
3 years ago
The duties of a database administrator include determining which people have access to what kinds of data in the database; these
fomenos

Answer:

Processing Rights.

Explanation:

The duties of a database administrator include determining which people have access to what kinds of data in the database; these are referred to as processing rights. There are other kind of rights too that will be decided by the Database Administrator. The database administrator grants access to different people depending on the usages of the database. There can be different types of data in the database. These are called the Processing rights.

7 0
3 years ago
Read 2 more answers
Mechanisms that can be used to rescue accident victims
stiks02 [169]

Answer:

Hydraulic rescue tools

6 0
2 years ago
How does the discussion of “Luddites,” “Marx,” and “John Maynard Keynes” in paragraph 21 contribute to the development of the id
gavmur [86]

Answer:

d

Explanation:

6 0
3 years ago
When a workforce scheduling problems is formulated as an integer programming model, it has:?
Dennis_Churaev [7]
More force because it's the impact
6 0
3 years ago
Other questions:
  • You are given 6 training examples for a binary classification problem as follows:
    12·1 answer
  • Columns are labeled with letters and Rows are labeled with numbers.
    5·1 answer
  • Hey guys. Can u help me pls? I need to add number1 and number2 together on Python, I don't know what I'm doing wrong. Thx for yo
    7·2 answers
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    12·1 answer
  • Why can't I register for Brainly?? I've been trying for months, too! I've noticed this question has been asked so many times, bu
    7·1 answer
  • Can someone please help me to point out what's wrong with this C program:
    13·1 answer
  • True or False? Security code is almost always open source!<br> True<br> False
    8·2 answers
  • Simple interest will always pay more interest than compound interest.
    14·1 answer
  • I'm having trouble with an assignment of mine. I'm making a text based adventure game for extra credit in my class and I'm stuck
    12·1 answer
  • Koi jinda hei kya hello​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!