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
How can you make the LED pattern continue to blink a certain number of times or indefinitely?
Maurinko [17]

Answer:

press flash

Explanation:

its on the bottom row on the remote on mine

8 0
3 years ago
Read 2 more answers
Complete data are very rare because some data are usually missing. There are typically four strategies to handle missing data.
netineya [11]

Answer:

see explaination

Explanation:

If I am to select I will select the strategy Impute the missing values . Because rather than deleting and all the other strategies. This is the best option because, this is an optional field as described there is no need for such accurate information about salary.

If we want to maintain this field we can just fill the value by identifying the similar records which is the other customers who is visiting the same no of times and fill that.

5 0
2 years ago
Which of the cached information retrieved will be the same as what is stored in the original server where the data is maintained
crimeas [40]

The answer is Yes, A browser cache is known to be a type of client-side cache, and it implies that it is also a type of site caching.

<h3>What is cache on a browser?</h3>

The browser cache is known to be a kind of 'cache' tool that is often used by a person's internet browser so that one can fasten up the page loading act.

Hence, The answer is Yes, A browser cache is known to be a type of client-side cache, and it implies that it is also a type of site caching.

Learn more about browser cache from

brainly.com/question/14598358

#SPJ1

7 0
1 year ago
1. Comments can be placed anywhere in Python, including in the middle of a line of code.
viva [34]

Answer:

This is true

Explanation:

Comments don't effect your program at all.

The computer doesn't even read the line with the comment, what you right before the comment tells the computer to skip this line.

So you can place them anywhere

6 0
3 years ago
What does the word complacency mean ?
bulgar [2K]

Answer:

a feeling of smug or uncritical satisfaction with oneself or one's achievements.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Do you believe that OOP should be phased out and we should start working on some alternative
    6·1 answer
  • Pascal's Triangle is a triangular array in which every number represents the
    15·1 answer
  • Express the following Boolean function using only the NOT and the AND operation
    6·1 answer
  • The set of instructions that tell the computer what to do are called ____.
    13·2 answers
  • To insert a new slide, which tab option should you select?
    12·2 answers
  • What term is used to refer to the merging of government services with information technology?
    11·1 answer
  • Bryan's company is new and has limited funds to work with. He has been tasked with finding a telecommunications technology that
    7·1 answer
  • How do cyber criminals target user’s end devices?
    11·2 answers
  • 7. Malware could A. cause a system to display annoying pop-up messages B. be utilized for identity theft by gathering personal i
    10·1 answer
  • In numpy to append two arreys vertically the function __ is used
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!