Advertisement
sabdas4869

ini insert data

Nov 30th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. func insert(T *arr, tot *int){
  2. var confirm string
  3.  
  4.  
  5.  
  6. i:=0
  7. i=*tot
  8. fmt.Print("::::::::::::::::::::::::::::::::::::::::::::\n")
  9. fmt.Print("Apakah Ingin Input : ")
  10. fmt.Scan(&confirm)
  11. fmt.Print("::::::::::::::::::::::::::::::::::::::::::::\n")
  12.  
  13. for (confirm != "no") && (i < N) {
  14. id++
  15.  
  16. T[i].id = id
  17. fmt.Print("Sekolah : ")
  18. fmt.Scan(&T[i].sekul)
  19. fmt.Print("Kelas : ")
  20. fmt.Scan(&T[i].kls)
  21. fmt.Print("Pelajaran : ")
  22. fmt.Scan(&T[i].pel)
  23. fmt.Print("Semester : ")
  24. fmt.Scan(&T[i].smt)
  25. fmt.Print("Silabus : ")
  26. fmt.Scan(&T[i].silb)
  27. fmt.Print("Materi : ")
  28. fmt.Scan(&T[i].mat)
  29.  
  30.  
  31. *tot++
  32. i++
  33. fmt.Print("::::::::::::::::::::::::::::::::::::::::::::\n")
  34. fmt.Print("Apakah anda ingin input lagi : ")
  35. fmt.Scan(&confirm)
  36. fmt.Print("::::::::::::::::::::::::::::::::::::::::::::\n")
  37.  
  38.  
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement