Asslamu'alaikum..
Sebenernya ini kuis dari dosen algortma & pemrograman. Tulis adja dahh... hehehe
Kurang lebih perwujudan programnya seperti di bawah .
Sintax nya sbb:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
ulang:
system("clear");
cout<<"======================\n";
cout<<"PROGRAM TAGIHAN WARNET\n";
cout<<"======================\n";
int a;
int c;
int d;
int e;
char b[20];
cout<<"No Komputer :";cin>>a;
cout<<"Nama Pemakai :";cin>>b;
cout<<"Lama pakai :";cin>>c;
{
if (c>=5)
{
d=c*4000*1/10;
e=c*4000-d;
}
if (c<=4)
{
d=0;
e=c*4000;
}
}
cout<<"======================\n";
cout<<"RINCIAN TAGIHAN WARNET\n";
cout<<"======================\n";
cout<<"No Komputer :"<<a<<endl;
cout<<"Nama Pemakai :"<<b<<endl;
cout<<"Lama pakai :"<<c<<endl;
cout<<"Potongan :"<<d<<endl;
cout<<"tagihan :"<<e<<endl;
char LG;
cout<<"Ulangi Lagi [ Y/T ] ?";cin>>LG;
if (LG=='Y' || LG=='y') goto ulang;
else if (LG=='T' || LG=='t') goto naon;
naon:
cout<<"Terima Kasih\n";
}
nuhun