SlideShare a Scribd company logo
1 of 4
Download to read offline
LATIHAN PERTEMUAN 4
ALORITMA & PEMOGRAMMAN
NIM : 12153213
NAMA : MUHAMAD FAISAL GOENIARTO
PROGRAM STUDI : AKADEMI MANAJEMEN INFORMATIK
&
KOMPUTER
JURUSAN : MANAJEMEN INFORMATIKA
KELAS : 12.1A.27
LATIHAN PERTEMUAN 4
#include <conio.h>
#include <stdio.h>
#include <iostream.h>
main()
{
char kode, nama_kereta[20], jurusan[20],nama_pembeli[20];
long int total, harga, jumlah_tiket,ppn;
long double total_bayar, uang_bayar, uang_kembali;
cout << " Stasiun Kereta Api " << endl;
cout << " bandung " << endl;
cout << "------------------------------ " << endl;
cout << "nama pembeli = ";cin >> nama_pembeli;
cout << "Pilih Kode Kereta [a/b/c] = ";
cin >> kode; if (kode=='a'||kode=='A')
{
strcpy(nama_kereta,"ARGO BROMO");
strcpy(jurusan,"YOGYAKARTA");
harga =300000;
}
else if (kode=='b'||kode=='B')
{
strcpy(nama_kereta,"ARGO LAMU");
strcpy(jurusan,"BANDUNG");
harga =200000;
}
else
{
strcpy(nama_kereta,"BHAYANGKARA");
strcpy(jurusan,"SURABAYA");
harga =350000;
}
cout << "Nama Kereta = " << nama_kereta << endl;
cout << "jurusan = " << jurusan << endl;
cout << "Harga = " << harga << endl;
cout << "Jumlah Tiket = " ;cin >> jumlah_tiket;
total = harga*jumlah_tiket;
cout << "total = " << total << endl;
cout << "-------------------------------" << endl;
ppn =(10*total/100);
cout << "ppn = " << ppn << endl;
total_bayar = ppn+total;
cout << "total bayar = " << total_bayar << endl;
cout << "uang bayar = ";cin >> uang_bayar;
uang_kembali = uang_bayar-total_bayar;
cout << "uang kembali = " << uang_kembali << endl;
getch();
}
AWAL INPUT, PEROSES,OUTPUT :
HASIL AKHIR :
Kode : a/A
Kode : b/B
Kode : c/C

More Related Content

Similar to soal program borland c++ (stasiun kereta api)

#includeiostream #includecmath #includestringusing na.pdf
 #includeiostream #includecmath #includestringusing na.pdf #includeiostream #includecmath #includestringusing na.pdf
#includeiostream #includecmath #includestringusing na.pdf
anuradhaartjwellery
 
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdfProject 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
aminbijal86
 
Parking Ticket SimulatorFor this assignment you will design a se.docx
Parking Ticket SimulatorFor this assignment you will design a se.docxParking Ticket SimulatorFor this assignment you will design a se.docx
Parking Ticket SimulatorFor this assignment you will design a se.docx
danhaley45372
 

Similar to soal program borland c++ (stasiun kereta api) (13)

CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT ) CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
 
Final year project working documentation 2020
Final year project working documentation 2020Final year project working documentation 2020
Final year project working documentation 2020
 
#includeiostream #includecmath #includestringusing na.pdf
 #includeiostream #includecmath #includestringusing na.pdf #includeiostream #includecmath #includestringusing na.pdf
#includeiostream #includecmath #includestringusing na.pdf
 
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdfProject 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 
PrimeNG - Components para la Vida Real
PrimeNG - Components para la Vida RealPrimeNG - Components para la Vida Real
PrimeNG - Components para la Vida Real
 
Creating an Uber Clone - Part XXVI - Transcript.pdf
Creating an Uber Clone - Part XXVI - Transcript.pdfCreating an Uber Clone - Part XXVI - Transcript.pdf
Creating an Uber Clone - Part XXVI - Transcript.pdf
 
Bus transportation query report
Bus transportation query reportBus transportation query report
Bus transportation query report
 
Parking Ticket SimulatorFor this assignment you will design a se.docx
Parking Ticket SimulatorFor this assignment you will design a se.docxParking Ticket SimulatorFor this assignment you will design a se.docx
Parking Ticket SimulatorFor this assignment you will design a se.docx
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced Aggregation
 
An Oracle approach to the Taxi Fare problem
An Oracle approach to the Taxi Fare problemAn Oracle approach to the Taxi Fare problem
An Oracle approach to the Taxi Fare problem
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 

soal program borland c++ (stasiun kereta api)

  • 1. LATIHAN PERTEMUAN 4 ALORITMA & PEMOGRAMMAN NIM : 12153213 NAMA : MUHAMAD FAISAL GOENIARTO PROGRAM STUDI : AKADEMI MANAJEMEN INFORMATIK & KOMPUTER JURUSAN : MANAJEMEN INFORMATIKA KELAS : 12.1A.27
  • 2. LATIHAN PERTEMUAN 4 #include <conio.h> #include <stdio.h> #include <iostream.h> main() { char kode, nama_kereta[20], jurusan[20],nama_pembeli[20]; long int total, harga, jumlah_tiket,ppn; long double total_bayar, uang_bayar, uang_kembali; cout << " Stasiun Kereta Api " << endl; cout << " bandung " << endl; cout << "------------------------------ " << endl; cout << "nama pembeli = ";cin >> nama_pembeli; cout << "Pilih Kode Kereta [a/b/c] = "; cin >> kode; if (kode=='a'||kode=='A') { strcpy(nama_kereta,"ARGO BROMO"); strcpy(jurusan,"YOGYAKARTA"); harga =300000; } else if (kode=='b'||kode=='B') { strcpy(nama_kereta,"ARGO LAMU"); strcpy(jurusan,"BANDUNG"); harga =200000; } else { strcpy(nama_kereta,"BHAYANGKARA"); strcpy(jurusan,"SURABAYA"); harga =350000; } cout << "Nama Kereta = " << nama_kereta << endl; cout << "jurusan = " << jurusan << endl; cout << "Harga = " << harga << endl; cout << "Jumlah Tiket = " ;cin >> jumlah_tiket; total = harga*jumlah_tiket; cout << "total = " << total << endl; cout << "-------------------------------" << endl; ppn =(10*total/100); cout << "ppn = " << ppn << endl; total_bayar = ppn+total; cout << "total bayar = " << total_bayar << endl; cout << "uang bayar = ";cin >> uang_bayar; uang_kembali = uang_bayar-total_bayar; cout << "uang kembali = " << uang_kembali << endl; getch(); }
  • 4. HASIL AKHIR : Kode : a/A Kode : b/B Kode : c/C