menu bar

Saturday, 9 April 2016

sekurang-kurangnya 4 baris puisi (boleh potongan lagu), kemudian buat program yang menampilkan per baris. Untuk menampilkan baris berikutnya, user diminta menekan sebuah tombol. 







#include <iostream>
#include<conio.h>
#include<fstream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;


int main(int argc, char** argv) {
int a,b ;
  int input ;


 
cout<<"LIRIK LAGU\n";
    cout<<"-----------------------------\n";
    cout<<"tugas diktat ALPRO\n";
    cout<<"-----------------------------\n";;
    cout<<"Lirik lagu\n";
    cout<<"-----------------------------\n";
    cout<<"<1> Kita adalah sepasang sepatu \n";
    cout<<"<2> Selalu bersama tak bisa bersatu\n";
    cout<<"<3> kita mati bagai tak berjiwa\n";
    cout<<"<4> Bergerak karena kakui manusia\n";
    cout<<"=============================\n";
   
    cout<<"masukkan no lirik ";cin>>input;
    while (input <6){
   cout<<"Tampilkan lirik lagu baris ke <1> <2> <3> <4> ?" ;
   cout<<"-----------------------------\n";
   cin>>input;
   cout<<"ANDA MEMILIH : \n";
   cout<<"-----------------------------\n";
   if (input==1){
    cout<<"\tNomor :satu\n";
      cout<<"\tKita adalah sepasang sepatu\n";
    cout<<"=============================\n";
   }
 
   else
   {
      if(input==2)
      {
      cout<<"\tNomor :dua\n";
    cout<<"\tSelalu bersama tak bisa bersatu\n";
    cout<<"=============================\n";
      }
      else
     if(input==3)
      {
      cout<<"\tNomor :tiga\n";
    cout<<"\tKita mati bagai tak berjiwa\n";
    cout<<"=============================\n";
      }
      else
     if(input==4)
      {
      cout<<"\tNomor :empat\n";
    cout<<"\tBergerak karena kakui manusia\n";
    cout<<"=============================\n";
      }
      else
      cout<<"anda salah memasukan";
   }
}
return 0;
}



No comments:

Post a Comment