0% found this document useful (0 votes)
37 views2 pages

Main - Java F

This document contains the code for a Java program that manages a rental store's VCD inventory. It defines classes and methods to input, add, and display VCD data. The main method displays a menu and uses a switch statement to call different methods based on the user's selection, such as adding a film or music VCD, or printing lists of the store's inventory.

Uploaded by

yutdfgvbchgfg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Main - Java F

This document contains the code for a Java program that manages a rental store's VCD inventory. It defines classes and methods to input, add, and display VCD data. The main method displays a menu and uses a switch statement to call different methods based on the user's selection, such as adding a film or music VCD, or printing lists of the store's inventory.

Uploaded by

yutdfgvbchgfg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

package com.

company;

import java.util.Scanner;

public class Main {

private final static Scanner scanner = new Scanner(System.in);

private static String title;


private static String publisher;
private static String category;
private static int stock;

public static void printMenu() {


System.out.println("\nTekan ");
System.out.println("0 - Untuk Melihat Menu");
System.out.println("1 - Untuk Keluar");
System.out.println("2 - Untuk Menambah VCD Film");
System.out.println("3 - Untuk Menambah VCD Music");
System.out.println("4 - Untuk Melihat Daftar VCD Film");
System.out.println("5 - Untuk Melihat Daftar VCD Musik");
System.out.println("6 - Untuk Melihat Semua VCD");
}

public static void inputVCD() {


System.out.println("Masukkan Judul:");
title = scanner.nextLine();
System.out.println("Masukkan Publisher:");
publisher = scanner.nextLine();
System.out.println("Masukkan Kategori:");
category = scanner.nextLine();
System.out.println("Masukkan Stok:");
stock = scanner.nextInt();
scanner.nextLine();
}

public static void main(String[] args) {


int choice;
RentalStore rentalVCD = new RentalStore();

System.out.println("Selamat Datang Di Penyewaan VCD Kami");

while (true) {
printMenu();
choice = scanner.nextInt();
scanner.nextLine();

switch (choice) {
case 0:
printMenu();
break;
case 1:
System.exit(0);
break;
case 2:
inputVCD();
System.out.println("Masukkan Sutradara");
String director = scanner.nextLine();
System.out.println("Masukkan Aktor");
String actor = scanner.nextLine();
rentalVCD.addFilm(title, publisher, category, director, actor,
stock);
break;
case 3:
inputVCD();
System.out.println("Masukkan Penyanyi");
String singer = scanner.nextLine();
rentalVCD.addMusic(title, publisher, category, singer, stock);
break;
case 4:
rentalVCD.printFilmList();
break;
case 5:
rentalVCD.printMusicList();
break;
case 6:
rentalVCD.printAllVCD();
}
}
}
}

You might also like