Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <conio.h>
  4. #include <windows.h>
  5.  
  6. using namespace std;
  7.  
  8. void gotoxy(int x, int y)
  9. {
  10. COORD coord;
  11. coord.X = x;
  12. coord.Y = y;
  13. SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
  14. }
  15.  
  16. int main(){
  17. int i,un[5],hg[20],total[20];
  18. char nm[10][5];
  19.  
  20. cout<<"\tdatar nama barang\n";
  21. cout<<"==================================================\n";
  22. cout<<" No | nama | unit | Harga | Total\n";
  23. cout<<"==================================================\n";
  24.  
  25. for(i=1;i>0;i++){
  26. gotoxy(1,3+i);cin>>i;
  27. gotoxy(5,3+i);cin>>nm[i];
  28. gotoxy(14,3+i);cin>>un[i];
  29. gotoxy(27,3+i);cin>>hg[i];
  30. total[i]=un[i]*hg[i];
  31. gotoxy(40,3+1);cout<<total[i];
  32.  
  33. getch();
  34. }
  35. cout<<"\n";
  36. cout<<"===========================================\n";
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement