Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <string.h>
- #include <conio.h>
- #include <iostream.h>
- #include <stdio.h>
- #include <windows.h>
- void setcolor(unsigned short color)
- {
- HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleTextAttribute(hCon,color);
- }
- main()
- {
- system ("title Tugas Kelompok 7 Struktur Data");
- char lagi;
- int indeks,test,r,username,password,ex;
- float x;
- int q[1000];
- int tugasss[4]=
- {1,2,3,4};
- char tugass[7] =
- {'A','M','I','K','B','S','I'};
- float tugas[7]=
- {1.3,2,3.3,4,5.7,8,9.9};
- cout << "--------------------------------------------------------------------------------";
- cout << "=============| Pogram untuk membaca input password dari user |==================";
- cout << "--------------------------------------------------------------------------------";
- int user = 123;
- int pass = 123;
- ex = 1;
- do {
- cout <<"\n";
- cout << "Username : ";
- cin >> username;
- cout << "Password : ";
- cin >> password;
- cout <<"\n";
- if (username == user && password == pass) {
- cout << "============================ \n";
- cout << "Anda Berhasil Login" << endl;
- cout << "============================ \n\n";
- } else
- {
- cout << "\n====================================\n";
- cout << "Maaf USERNAME & PASSWORD ANDA Salah!" << endl;
- cout << "====================================\n\n";
- ex = ex +1;
- }
- }
- while (ex <= 3);
- cout << "Anda Telah 3x Memasukan ID & PASSWORD Yang Salah\n";
- cout << "Mohon Maaf kesempatan Anda hanya 3x ";
- setcolor(11);
- cout<<endl;
- char a[]={"\tWELCOME TO ONE DIMENSIONAL ARRAY PROGRAM\n"};
- char b[]={"\t\t PRESENT BY GROUP 7\n"};
- int i;
- double j;
- for(i=0;a[i]!='\0';i++){
- printf("%c",a[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- for(i=0;b[i]!='\0';i++){
- printf("%c",b[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- cout<<endl;
- cout<<endl;
- setcolor(10);
- char c[]={"\t\t12151111\tARDIANSYAH\n"};
- for(i=0;c[i]!='\0';i++){
- printf("%c",c[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- cout<<endl;
- char d[]={"\t\t12151111\tFIKI\n"};
- for(i=0;d[i]!='\0';i++){
- printf("%c",d[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- cout<<endl;
- char e[]={"\t\t12153528\tJAMALUDIN\n"};
- for(i=0;e[i]!='\0';i++){
- printf("%c",e[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- cout<<endl;
- char f[]={"\t\t12151692\tANISA SAFITRI\n"};
- for(i=0;f[i]!='\0';i++){
- printf("%c",f[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- cout<<endl;
- char g[]={"\t\t12150854\tSALWA SRI DUNYA\n"};
- for(i=0;g[i]!='\0';i++){
- printf("%c",g[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- clrscr();
- //deklarasi string x
- setcolor(27);
- char k[]="PLEASE WAIT...PROGRAM IS BEING STARTED!!!";
- //deklarasi variabel bertipe integer
- int l,m,n;
- //perulangan 5x untuk memunculkan string x sebanyak 5x
- for(n=0; n<5; n++)
- {
- //clear screen
- system("cls");
- //perulangan untuk menimbulkan jeda waktu
- for(l=0; l<199999;l++)
- {
- for(m=0; m<1999; m++)
- {
- }
- }
- //mencetak string k
- printf("\n\n%s",k);
- //perulangan untuk menimbulkan jeda waktu
- for(l=0; l<199999;l++)
- {
- for(m=0; m<1999; m++){
- }
- }
- }
- mulai:
- clrscr();
- cout<<endl;
- setcolor(12);
- cout<<"\t SELAMAT DATANG \n";
- cout<<"\t MENU ARRAY DIMENSI SATU \n";
- cout<<"\t KELOMPOK TUJUH \n";
- cout<<endl;
- setcolor(11);
- cout<<"\t1. Inisialisasi Array Part I \n";
- cout<<"\t2. Inisialisasi Array Part II \n";
- cout<<"\t3. Inisialisasi Array Part III \n";
- cout<<"\t4. Inisialisasi Array Part IV \n";
- cout<<"\t5. Keluar \n";
- cout<<endl;
- setcolor(9);
- cout<<"\tMasukan Program Yang di Pilih [1,2,3,4] = ";cin>>test;
- switch(test)
- {
- case 1:
- clrscr();
- {
- cout<<endl;
- setcolor(12);
- cout<<"\tInisialisasi Array Part I"<<endl;
- cout<<endl;
- setcolor(11);
- for (char t = 0; t < 7; t++)
- {
- cout<<"\tElemen Array Ke ["<<(t+1)<<"] = "<<tugass[t]<<endl;
- }
- cout<<endl;
- cout<<"\tPlease Enter To Continue...";
- getch();
- clrscr();
- cout<<endl;
- setcolor(9);
- cout<<"\tIngin Input Lagi[Y/T] : ";
- cin>>lagi;
- if(lagi=='Y' ||lagi=='y')
- goto mulai;
- break;
- }
- case 2:
- clrscr( );
- {
- cout<<endl;
- setcolor(12);
- cout<<"\tInisialisasi Array Part II "<<endl;
- cout<<endl;
- setcolor(11);
- for (int t = 0; t < 4; t++)
- {
- cout<<"\tElemen Array ke ["<<(t+1)<<"] = "<<tugasss[t]<<endl;
- }
- tugasss[0]=7;
- tugasss[1]=8;
- tugasss[2]=9;
- tugasss[3]=10;
- cout<<endl;
- cout<<"\tInisialisasi Aray Yang Baru :"<<endl;
- cout<<endl;
- for (int t = 0; t < 4; t++)
- {
- cout<<"\tElemen Array Ke ["<<(t+1)<<"] = "<<tugasss[t]<<endl;
- }
- cout<<endl;
- cout<<"\tPlease Enter To Continue...";
- getch();
- clrscr();
- cout<<endl;
- setcolor(9);
- cout<<"\tIngin Input Lagi[Y/T] : ";
- cin>>lagi;
- if(lagi=='Y' ||lagi=='y')
- goto mulai;
- break;
- }
- case 3:
- clrscr();
- {
- cout<<endl;
- setcolor(12);
- cout<<"\tInisialisasi Array Part III"<<endl;
- cout<<endl;
- setcolor(11);
- for(r=0;r<5;r++)
- {
- cout<<"\tMasukkan Elemen Array ["<<(r+1)<<"] = ";cin>>q[r];
- }
- cout<<endl;
- cout<<"\tElemen Array Yang Telah di Input : "<<endl;
- for(r=0;r<5;r++)
- {
- cout<<"\tElemen Array Ke ["<<(r+1)<<"] = "<<q[r]<<endl;
- }
- cout<<endl;
- cout<<"\tPlease Enter To Continue...";
- getch();
- clrscr();
- cout<<endl;
- setcolor(9);
- cout<<"\tIngin Input Lagi[Y/T] : ";
- cin>>lagi;
- if(lagi=='Y' ||lagi=='y')
- goto mulai;
- break;
- }
- case 4:
- clrscr();
- {
- cout<<endl;
- setcolor(12);
- cout<<"\tInisialisasi Array Part IV "<<endl;
- cout<<endl;
- setcolor(11);
- for (int t = 0; t < 7; t++)
- {
- cout<<"\tElemen Array Ke ["<<(t+1)<<"] = "<<tugas[t]<<endl;
- }
- cout<<endl;
- setcolor(10);
- cout<<"\tMasukkan Indeks Yang Akan di Ganti : ";
- cin>>indeks;
- cout<<"\tMasukan Nilai Yang Akan di Ganti : ";
- cin>>x;
- tugas[indeks]=x;
- cout<<endl;
- setcolor(12);
- cout<<"\tNilai Array Yang Baru : "<<endl;
- cout<<endl;
- setcolor(11);
- for (int t = 0; t < 7; t++)
- {
- cout<<"\tElemen Array Ke ["<<(t+1)<<"] = "<<tugas[t]<<endl;
- }
- cout<<endl;
- cout<<"\tPlease Enter To Continue...";
- getch();
- clrscr();
- cout<<endl;
- setcolor(9);
- cout<<"\tIngin Input Lagi[Y/T] : ";
- cin>>lagi;
- if(lagi=='Y' ||lagi=='y')
- goto mulai;
- break;
- }
- case 5:
- clrscr();
- {
- cout<<endl;
- setcolor(11);
- char a[]={"\tTHANKYOU FOR YOUR ATTENTION\n"};
- char b[]={"\t\tGOOD BYE\n"};
- int i;
- double j;
- for(i=0;a[i]!='\0';i++){
- printf("%c",a[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- for(i=0;b[i]!='\0';i++){
- printf("%c",b[i]);
- for(j=0;j<=19999999;j++){
- }
- }
- cout<<endl;
- cout<<endl;
- cout<<"\tPlease Enter To Continue...";
- break;
- }
- default:
- clrscr();
- {
- cout<<endl;
- setcolor(11);
- cout<<"\tMenu Tidak Tersedia Harap Pilih Yang Benar !!!";
- getch();
- goto mulai;
- }
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement