Sie sind auf Seite 1von 3

200910/KI/T0016/Soal05 FM-BINUS-AA-FPT-66/R4

Soal Praktikum
Practicum Case

T0016
Algoritma dan Pemrograman
Jurusan
Kelas 01PGT 01PHT 01PIT 01PJT 01PKT 01PLT 01PMT Department
Class Teknik Informasi
Computer Science
Periode Berlaku Semester Ganjil 2010/2011 Revisi 00
Valid on Odd Semester Year 2010/2011 Revision00

Tujuan Instruksional Khusus


Special Instructional Course
 Write a program in C language in problem solving
Pokok Bahasan
Subject Discussion
 Array 1 D
 Array 2 D
Materi
Material
 Creating a modular program using array 1D
 Creating a modular program using array 2D
Soal
Case

You are about to make a program to help Bao Horse Racing. Here are the descriptions of the
program:
 First, ask user to input name. The length of name must be between 2 and 25.
 User get $ 1000 to bet.
 Show all available horses, each horse’s speed is obtained from the result of random between
25 km/hour and 40 km/hour.
 Ask user to input preferred horse number. The value must be between 1 and 10.
 Ask user to input betting money. The value must be between $100 and the rest of user’s
money.
 Ask user to confirm his/her input. The value must be ‘Y’ or ‘N’ (not case-sensitive).
o If user inputs ‘Y’ or ‘y’ and the chosen horse is the fastest horse then user is the winner and
add twice of betting money to user’s money.
o If user inputs ‘Y’ or ‘y’ and the chosen horse is not the fastest horse then user is lost and
substract user’s money as much as the betting money.
o If user inputs ‘N’ or ‘n’ then user have to re-input horse number and betting money.

Halaman : 1 dari 3
Page 1 of 3
 Program will keep continue until user’s money is equals or less then 0 or user chooses not to
continue the program.

Please run the EXE file to see the sample program.

Print Screen of Welcome Screen

Print Screen of Available Horse

Print Screen of Betting

Print Screen of Lose

Halaman : 2 dari 3
Page 2 of 3
Print Screen of Win

Print Screen of End Screen

Halaman : 3 dari 3
Page 3 of 3

Das könnte Ihnen auch gefallen