Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. void entregarEncomendasEmMovimento(estrutEncomendas encomendas[MAX_ENCOMENDAS],int encomendasRegistadas,tipoveiculos veiculos[MAX_VEICULOS],int quantVeiculos,int numEntregues){
  2.  
  3. int i,j,op;
  4.  
  5. if(quantVeiculos == 0 || encomendasRegistadas == 0){
  6.  
  7. printf("Nao e possivel entregar nao existe nenhum veiculo/encomenda");
  8. }else{
  9. for (i=0; i < quantVeiculos; i++){
  10. if(veiculos[i].estado == 2){
  11. for(j=0; j < encomendasRegistadas; j++){
  12. if(encomendas[j].estado == 2){
  13. if(veiculos[i].matricula == encomendas[j].matriculaVeiculo){
  14. printf("\nEscolha o que quer fazer com a encomenda\n");
  15. printf("1 - Devolver\n");
  16. printf("2 - Entregar\n");
  17. op = lerInteiro("\nIntroduza a sua opcao: ",1,2);
  18.  
  19. switch(op){
  20. case 1:
  21. encomendas[j].estado = 3;
  22. veiculos[i].nEncomendasNoVeiculo--;
  23. veiculos[i].viagensEfetuadas;
  24. veiculos[i].encTransportadas;
  25.  
  26. numEntregues++;
  27. break;
  28. case 2:
  29. encomendas[j].estado = 4;
  30. break;
  31.  
  32. }
  33.  
  34.  
  35. }
  36.  
  37.  
  38.  
  39.  
  40. }
  41. }
  42. }
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement