Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import osu.cse 3 2 4 1 . utilities.Utilities;F import osu.cse 3 2 4 1 . sql . SQL; import osu.cse 3 2 4 1 .

import osu.cse3241.utilities.Utilities;F
import osu.cse3241.sql.SQL;
import osu.cse3241.GRS;
public class ViewArtistTrack {
private static Set MENU_OPTIONS = new HashSet<>(Arrays.asList('1','2','x'));
public static void menu(Scanner cin){
Utilities.printDivider();
System.out.print("VIEW ALL:
"
+"1. Artists
"
+"2. Tracks
"
+ "Input numerical selection (or 'x' to quit): ");
String input = cin.nextLine();
char selection =!input.isEmpty()? input.charAt(0) : '';
while(!MENU_OPTIONS.contains(selection)){
System.out.print("Incorrect option specified! Try again: ");
input = cin.nextLine();
selection =!input.isEmpty()? input.charAt(0) : '';
}
switch(selection){
case '1':
viewArtists();
break;
case '2':
viewTracks();
break;
default:
break;
}
}
/*
* PART 4:
* Remove the placeholder method and complete one of the following methods:
*
* viewTracks()
* viewArtists()
*
*/
/**
* Query all tracks contained in database.
*/
private static void viewTracks(){
Utilities.placeholder();
/* TODO
String sql = null;
SQL.sqlQuery(GRS.conn, sql);
*/
}
/**
* Query all artists contained in database.
*/
private static void viewArtists(){
Utilities.placeholder();
/* TODO
String sql = null;
SQL.sqlQuery(GRS.conn, sql);
*/
}
}
Fill in the TODO

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions