0% found this document useful (0 votes)
15 views5 pages

Upload Tugas Extension

The document outlines requirements for a movie rental application including adding movies with validation, viewing movies sorted by title, renting movies with validation of index and payment, and exiting. Movies have attributes of title, genre, rating, ID, price determined by title length and genre. The application uses menus and input validation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Upload Tugas Extension

The document outlines requirements for a movie rental application including adding movies with validation, viewing movies sorted by title, renting movies with validation of index and payment, and exiting. Movies have attributes of title, genre, rating, ID, price determined by title length and genre. The application uses menus and input validation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

`Perhatikan soal dibawah ini


2. Sebuah hotel membutuhkan program untuk menyimpan data transaksi yakni nama
pengunjung, tipe kamar, harga kamar, lama menginap dan total bayar.
Ketentuan dari program yang akan di buat adalah sebagai berikut :
a) Harga standard room = Rp. 400.000, superior room = Rp. 500.000, deluxe room = Rp.
650.000, dan suite room = Rp. 750.000
b) Terdapat method untuk menghitung biaya yang harus di bayarkan oleh pengunjung
hotel yang didapat dari perkalian harga kamar dengan lama menginap
c) Buatlah kelas utama untuk menjalankan kelas tersebut
d) Gunakan proses input untuk memasukkan data (scanner)
e) Tampilkan output dari semua atribut yang disebutkan diatas
4. Buatlah program bebas (tidak boleh sama dengan mhs lain) dengan menggunakan semua
materi yang telah dibahas :
(method void, return, konstruktor , keyword "this“)
dengan inputan menggunakan scanner !!!

.5. Movie Rental


Movie Rental is a store that rents new Movies. Movie Rental needs an application to
manage their products. As a programmer, you are asked to create the application. The application
should be created with Java Programming Language based on the following specifications:
· The application consists of 4 menus:
1. Add New Movie
2. View Movie (Sort by Title ascending)
3. Rent Movie
4. Exit

Figure 1. Screen for Main Menu

· If the user chooses menu 1 (“Add New Movie”), the application will:
o Ask user to input Movie’s Title. Validate that the Title’s length must be between 3
and 20 characters
o Ask user to input Movie’s Genre. Validate that the Movie’s genre must be filled
with either “Horror” , “Comedy”, or “Action” (case sensitive)
o Ask user to input Movie Rating. Validate that the Movie’s Rating must be between
1 and 10
o Generate the Movie’s ID based on the following format

XXYYY
Where
X = Random Character between A and Z
Y = Random Number between 0-9

Correct: AB123, BA223


Wrong: 1BAC2, B2J12

o Determine the additional Price based on Genre:

Genre Additional Price


Comedy 3000
Action 4000
Horror 5000

o The Program will Calculate the Total Price with following formula

Total Price = (Movie’s Title Char Length * 500) + Additional Price


Figure 2. Screen for Input and Validation

· If the user chooses menu 2 (“View Movie Sort by Title Ascending”):


o If there is no Movie in the list, show a warning message “No Movie Found”

Figure 3. Screen for Warning Message


o Otherwise, show all Movies in the list, sorted by title ascending

Figure 4. Screen for Movie List Sorted by Title Ascending

· If the user chooses menu 3 (“Rent Movie”) :


o If there is no Movie in the list, show a warning message “No Movie Found”

Figure 5. Screen for Warning Message


o Ask user to input Movie’s index to rent. Validate that the index must be between 1
and total of Movie’s and index must be numeric
o Ask user to input Money for paying rent. Validate that the money must be more
than equals the Price then show success message “Pay Rent Successful with [change]
Change”
o Delete the movie from the list afterwards
Figure 6. Screen for Menu Rent Movie

· If user chooses menu 4 (“Exit”), the application will exit

You might also like