Advertisement
Guest User

ex4

a guest
May 22nd, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct dadosImposto {
  5. string nome;
  6. float valor;
  7. };
  8.  
  9. struct dadosNota {
  10. string descricao;
  11. float valor;
  12. string nome;
  13. };
  14.  
  15. void lerImposto(int n){
  16.  
  17. dadosImposto imposto[n];
  18.  
  19. for (int i=0; i<n; i++)
  20. cin>>imposto[i].nome>>imposto[i].valor;
  21. }
  22.  
  23. void notaDescricao(int n, string descricao[]){
  24. for (int i=0; i<n; i++)
  25. cin>>descricao[i];
  26. }
  27.  
  28. void notaValor(int n, float valor[]) {
  29. for (int i=0; i<n; i++)
  30. cin>>valor[i];
  31. }
  32.  
  33. void notaNome(int n, string nome[]) {
  34. for (int i=0; i<n; i++)
  35. cin>>nome[i];
  36. }
  37.  
  38. void lerNota(int n){
  39.  
  40. dadosNota nota[n];
  41. string descricao[n];
  42. float valor[n];
  43. string nome[n];
  44.  
  45. notaDescricao(n, descricao);
  46. notaValor(n, valor);
  47. notaNome(n, nome);
  48.  
  49. for (int i=0; i<n; i++){
  50. nota[i].descricao=descricao[i];//trocar pelos vetores q deveriam ser feitos
  51. nota[i].valor=valor[i];
  52. nota[i].nome=nome[i];
  53. }
  54. for (int i=0; i<n; i++)
  55. cout<<"yeis"<<endl;
  56. }
  57.  
  58. float cadaImposto(float valorimposto,float valornota){
  59.  
  60. int impostoCada;
  61.  
  62. return impostoCada;
  63. }
  64.  
  65. int main(){
  66.  
  67. int nn;
  68.  
  69. cin>>nn;
  70.  
  71. lerNota(nn);
  72.  
  73. return 0;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement