Daftar

[ask] mohon bantuannya gan sempurnain codingan java ane


Programming & Web Coding, web, aplikasi, dan karier developer.

Balas
 
Alat Thread
SinggahDapur SinggahDapur sedang offline
20th November 2011 #1
Ceriwiser Tanggal Bergabung: Nov 2011 Post: 348 Rep Power: 16 SinggahDapur mempunyai hidup yang Normal
Default [ask] mohon bantuannya gan sempurnain codingan java ane
soalnya gini gan :



Having dropped out of school because of chemistry, Luka got a job driving trucks. One evening he parked his three trucks in a rest area which charges for parking in an unusual way � they give a discount on quantity.



When only one truck is parked, the driver pays A kuna per minute. When two trucks are parked, the drivers each pay B kuna per minute. When three trucks are parked, the drivers each pay C kuna per minute.



Given the numbers A, B and C, as well as the intervals in which Luka's three trucks are parked, determines how much Luka needs to pay the owner of the rest area.



INPUT:

The first line contains three integers A, B and C (1 ≤ C ≤ B ≤ A ≤ 100), the prices of parking as defined above. Each of the following three lines contains two integers each. These are the arrival and departure times (in minutes) of one of Luka's trucks. The arrival time will always be earlier than the departure time. All time indexes will be between 1 and 100.



OUTPUT:

Output the overall cost of Luka's parking his three trucks.





Input:

5 3 1

1 6

3 5

2 8



Output:

33







Input:

10 8 6

15 30

25 50

70 80



Output:

480





ane udah coba-coba coding gini gan





import java.util.Scanner;





class taskPark {



public static void main (String [] ar) {

Scanner scan = new Scanner (System.in);



int mobil1[] = new int [100];

int mobil2[] = new int [100];

int mobil3[] = new int [100];





int A = scan.nextInt();

int B = scan.nextInt();

int C = scan.nextInt();





int datang1 = scan.nextInt();

int pergi1 = scan.nextInt();

int datang2 = scan.nextInt();

int pergi2 = scan.nextInt();

int datang3 = scan.nextInt();

int pergi3 = scan.nextInt();



int totalPay=0;



for (int i=datang1; i
Balas


Aturan Posting
Kamu tidak boleh membuat thread baru
Kamu tidak boleh membalas
Kamu tidak boleh mengirim lampiran
Kamu tidak boleh mengedit post kamu

BB code Hidup
Smilie saat ini Hidup
Kode [IMG] adalah Hidup
Kode HTML adalah Mati


Terkait
Thread Pembuat Thread Forum Balasan Postingan Terakhir
Mohon bantuannya jenglotman Misteri & Horor 0 24th April 2012 09:47 AM
mohon bantuannya.. tuyulsakti Misteri & Horor 0 22nd April 2012 05:36 PM
[Share] berbagi codingan JAVA (sini yg punya codingan nya) PHPmaster Programming & Web 0 20th November 2011 09:22 AM
[ask] array java mohon bantuannya Servermaster Programming & Web 0 20th November 2011 02:36 AM
Mohon bantuannya khabib Diskusi Virus 3 9th November 2011 06:45 PM

Semua waktu adalah GMT +7. Waktu sekarang adalah 04:58 AM.