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
If the fluid level in a battery is below the separators<br> should be added but never add
geniusboy [140]
Never add tap water to your battery. ... Battery electrolyte levels should be just below the bottom of the vent well, about ½ - ¾ inch above the tops of the separators. Never let the electrolyte level to drop below the top of the plates.
7 0
3 years ago
Jeremy is designing a website for a florist. He intends to discuss the web design with his client. Which tool should Jeremy use
stiv31 [10]

Answer:

C.  layout of each page with its respective elements

Explanation:

A layout  of each page with its respective elements will give the client a good idea of the final product and help him confirm his desires/requests towards the creation of the Web site.  Most people are visual, especially about things they don't fully understand, so a clear and visual representation is best.

<u>A. Bulleted lists and titles</u>... won't give the idea of the full layout of the Web site.

<u>B. chart depicting</u>....  that's more a tool for the programmer than the client, although user flow is important, it isn't as much as the visual aspect of each page.

<u>D. pictures and screenshots of websites of other florists..</u>. That could be a useful aid on the first contact, but the question implied the Web site is already in progress... so that wouldn't help much.

<u>E.  programming code for the website</u>, absolutely not, the client hired Jeremy not to have to deal with that.

5 0
3 years ago
What is used to configure data sources for applications that require access to a database?
Radda [10]
A network is used to configure data sources for applications that require access to a database?
6 0
3 years ago
Your friend Amy calls you asking for help with her new LCD monitor. She says the monitor isn't showing the whole picture. What i
swat32

Answer:     probably 1080p (which is HD)

Explanation:    Lcd monitors mainly support 1080p.

3 0
3 years ago
Which for loop syntax is correct?
Ugo [173]

Answer:

C

Explanation:

3 0
2 years ago
Other questions:
  • Demonstrate your grasp of the Unix file system by constructing a directory structure as follows: In your home ( ~ ) directory, c
    11·1 answer
  • Which of the following is an occupation management group? Select the choice that best answers the question.
    15·1 answer
  • Troubleshooting comes before diagnosing. Answer: false
    7·1 answer
  • Describe mobile computing
    7·1 answer
  • Siva added a "Contact Form" to her website.
    10·1 answer
  • Given the integer variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another integer va
    7·1 answer
  • All of the following are organization habits except:
    10·1 answer
  • Rounding up and down for 389,422
    7·1 answer
  • Which two choices are examples of trivial file transfer protocol (tftp) use? (choose two. )
    5·1 answer
  • Which example best demonstrates an impact of computers on the economy?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!