Kumpulan Kode Program C++

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Kumpulan Kode Program C++ as PDF for free.

More details

  • Words: 944
  • Pages: 9
PROGRAM BERAT BADAN IDEAL (BMI) #include <stdio.h> #include void main() { int BB,TB1; float TB2; float BBI,BMI; mulai: printf("\t# HITUNG BERAT BADAN IDEAL #\n"); printf("\t# BODY MASS INDEX CALCULATION #\n\n"); printf("BERAT BADAN(kg) =\n"); scanf("%d",&BB); printf("TINGGI BADAN(cm)(ex:180) =\n"); scanf("%d",&TB1); printf("TINGGI BADAN(m)(ex:1.80) =\n"); scanf("%f",&TB2); printf("========================================\n"); BMI=BB/(TB2*TB2); BBI=(TB1-100)*90/100; printf("BERAT IDEAL ANDA = %f\n",BBI); printf("BODY MASS INDEX ANDA = %f\n",BMI); if (BMI<18.5 && BMI>=0) {printf("KETERANGAN = UNDER WEIGHT\n\n");} else if (BMI>=18.5 && BMI<25) {printf("KETERANGAN = NORMAL\n\n");} else if (BMI>=25 && BMI<30) {printf("KETERANGAN = OVER WEIGHT\n\n");} else if (BMI>=30) {printf("KETERANGAN = OBESITAS\n\n");} else {printf("KETERANGAN = ERROR ON INPUT NUMBER\n\n");} printf("ULANGI PERHITUNGAN ?"); getch(); clrscr(); goto mulai; }

PROGRAM NILAI KELULUSAN #include <stdio.h> #include void main() { int nilai; int nm; mulai: printf("\tUJI KELULUSAN\n\n"); printf("Masukan Nilai UN anda = "); scanf("%d", &nilai); printf("Masukan Nilai Minimal Kelulusan = "); scanf("%d", &nm); printf("====================================\n\n"); if (nilai>=nm && nilai<=100) { printf("SELAMAT ANDA LULUS !!!\n\n"); } else if (nilai>=0 && nilai
PROGRAM RUMUS TENSES #include<stdio.h> #include void main() { int a,b; mulai: printf("\t*TENSES FORMULA*\n\n"); printf("================================\n\n"); printf("Pilihan :\n"); printf("1. PRESENT TENSE\n"); printf("2. PAST TENSE\n"); printf("3. FUTURE TENSE\n"); printf("4. PAST FUTURE TENSE\n\n");

printf("MASUKAN PILIHAN ANDA :"); scanf("%d", &a); printf("================================\n\n"); if (a>0 && a<2) {printf("PILIH KONDISI :\n\n"); printf("1. SIMPLE PRESENT TENSE\n"); printf("2. PRESENT CONTINUOUS TENSE\n"); printf("3. PRESENT PERFECT TENSE\n"); printf("4. PRESENT PERFECT CONTINUOUS TENSE\n\n"); printf("MASUKAN PILIHAN ANDA :"); scanf("%d",&b); clrscr(); if (b>0 && b<2) { printf("===================================\n"); printf("#SIMPLE PRESENT TENSE#\n\n"); printf("rumus :\n"); printf("\tsubject + verbI\n"); printf("Ex :\n"); printf("\tI go to campus almost every day.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>1 && b<3) { printf("===================================\n"); printf("#PRESENT CONTINUOUS TENSE#\n\n"); printf("rumus :\n");

printf("\tSubject + TO BE(am, is, are) + verbI+ing\n"); printf("Ex :\n"); printf("\tWe are studying English now.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>2 && b<4) { printf("===================================\n"); printf("#PRESENT PERFECT TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + have/has + verbIII\n"); printf("Ex :\n"); printf("\tI have written letter\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>3 && b<5) { printf("===================================\n"); printf("#PRESENT PERFECT CONTINUOUS TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + have/has + been + verbI+ing\n"); printf("Ex :\n"); printf("\tShe has been staying at my house this year.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else {printf("===================================\n"); printf("\t\tERROR\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } } else if (a>1 && a<3) {printf("PILIH KONDISI :\n\n"); printf("1. SIMPLE PAST TENSE\n");

printf("2. PAST CONTINUOUS TENSE\n"); printf("3. PAST PERFECT TENSE\n"); printf("4. PAST PERFECT CONTINUOUS TENSE\n\n"); printf("MASUKAN PILIHAN ANDA :"); scanf("%d",&b); clrscr(); if (b>0 && b<2) { printf("===================================\n"); printf("#SIMPLE PAST TENSE#\n\n"); printf("rumus :\n"); printf("\tsubject + verbII\n"); printf("Ex :\n"); printf("\tI went to Indralaya yesterday.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>1 && b<3) { printf("===================================\n"); printf("#PAST CONTINUOUS TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + was/were + verbI+ing\n"); printf("Ex :\n"); printf("\tI was writing letter.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>2 && b<4) { printf("===================================\n"); printf("#PAST PERFECT TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + had + verbIII\n"); printf("Ex :\n"); printf("\tWe had gone to campus.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>3 && b<5) {

printf("===================================\n"); printf("#PAST PERFECT CONTINUOUS TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + had + been + verbI+ing\n"); printf("Ex :\n"); printf("\tYou had been studying English.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else {printf("===================================\n"); printf("\t\tERROR\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } } else if (a>2 && a<4) {printf("PILIH KONDISI :\n\n"); printf("1. SIMPLE FUTURE TENSE\n"); printf("2. FUTURE CONTINUOUS TENSE\n"); printf("3. FUTURE PERFECT TENSE\n"); printf("4. FUTURE PERFECT CONTINUOUS TENSE\n\n"); printf("MASUKAN PILIHAN ANDA :"); scanf("%d",&b); clrscr(); if (b>0 && b<2) { printf("===================================\n"); printf("#SIMPLE FUTURE TENSE#\n\n"); printf("rumus :\n"); printf("\tsubject + will/shall + verbI\n"); printf("Ex :\n"); printf("\tI will post the letter.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>1 && b<3) { printf("===================================\n"); printf("#FUTURE CONTINUOUS TENSE#\n\n"); printf("rumus :\n");

printf("\tSubject + will/shall + be + verbI+ing\n"); printf("Ex :\n"); printf("\tI will be writing at seven o'clock tomorrow.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>2 && b<4) { printf("===================================\n"); printf("#FUTURE PERFECT TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + will/shall + have + verbIII\n"); printf("Ex :\n"); printf("\tHE will have gone to campus.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>3 && b<5) { printf("===================================\n"); printf("#FUTURE PERFECT CONTINUOUS TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + will/shall + have + been + verbI+ing\n"); printf("Ex :\n"); printf("\tI will have been swimming.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else {printf("===================================\n"); printf("\t\tERROR\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } } else if (a>3 && a<5) {printf("PILIH KONDISI :\n\n"); printf("1. PAST FUTURE TENSE\n");

printf("2. PAST FUTURE CONTINUOUS TENSE\n"); printf("3. PAST FUTURE PERFECT TENSE\n"); printf("4. PAST FUTURE PERFECT CONTINUOUS TENSE\n\n"); printf("MASUKAN PILIHAN ANDA :"); scanf("%d",&b); clrscr(); if (b>0 && b<2) { printf("===================================\n"); printf("#PAST FUTURE TENSE#\n\n"); printf("rumus :\n"); printf("\tsubject + would/should + verbI\n"); printf("Ex :\n"); printf("\tI would go to Indralaya the following day.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>1 && b<3) { printf("===================================\n"); printf("#PAST FUTURE CONTINUOUS TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + would/should + be + verbI+ing\n"); printf("Ex :\n"); printf("\tWe should be going to campus.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>2 && b<4) { printf("===================================\n"); printf("#PAST FUTURE PERFECT TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + would/should + have + verbIII\n"); printf("Ex :\n"); printf("\tShe would have written letter.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else if (b>3 && b<5) {

printf("===================================\n"); printf("#PAST FUTURE PERFECT CONTINUOUS TENSE#\n\n"); printf("rumus :\n"); printf("\tSubject + would/should + have + been + verbI+ing\n"); printf("Ex :\n"); printf("\tI would have been studying English for nine years.\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } else {printf("===================================\n"); printf("\t\tERROR\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } } else {clrscr(); printf("===================================\n"); printf("\t\tERROR\n"); printf("===================================\n"); printf("Ulangi ?"); getch(); clrscr(); goto mulai; } }

Related Documents