Ir ao conteúdo

Lista encadeada, Estrutura de dados.

Saudações,

Para não perder o costume, irei postar outro exercicio resolvido em uma aula. Dessa vez o exercicio é o seguinte:
– Implemenetar o sistema de contabilidade de um mafioso. (outros detalhes continue lendo o post)

O enunciado do mesmo se encontra no “read the rest of this entry” para não deixar o post muito extenso devido ao longo enunciado.

A resolução do mesmo você pode baixar aqui.

Você é um Mafioso informatizado.
Você vai criar um sistema para gerenciar os seus débitos e também as pessoas que devem a você.
Este sistema será baseado em duas listas encadeadas:

(Imagem de exemplo)

* Para isso você vai fazer um programa que manipula mais de uma lista;

* o programa fará isto com um único conjunto de funções e passagem das diversas listas como parâmetros;
* como aplicação imaginemos um sistema de contabilidade simples;
* você vai ter um Plano de Contas constituído por duas listas: débitos e créditos;
* o mesmo conjunto de funções (que você já implementou) vai poder ser utilizado para isso: você somente precisa ampliar o conjunto de parâmetros da função para passar por referência também a lista que você quer alterar.

A passagem de parâmetro da lista deve ser por referência porque você deseja que as alterações sejam persistentes.

Cada lista de débitos ou créditos é constituída por lançamentos. Cada lançamento possui:

* um valor real (positivo);
* um nome. Por exemplo, “Pagar proteção à Mafia”

Estrutura:
tipo tLançamento {
caracter *nome;
real valor;
};

A lista encadeada que conterá os lançamentos terá um elemento de lista definido da seguinte forma:
Estrutura:
tipo tLista {
tLancamento* info;
tLista* proximo;
};
A cabeça de lista de cada lista será uma variável global contendo uma estrutura como abaixo:
tipo cLista {
tLista* lista;
inteiro ultimo;
};

No programa principal você vai definir se vai realizar uma operação de débito ou de crédito e vai chamar as operações sobre listas necessárias, passando a lista correta como parâmetro (por referência) para a função que realiza a operação.

Além das operações básicas que a lIsta vai oferecer, você deve implementar uma operação adicional: totalização. Essa operação funciona assim:

* percorre a lista, escrevendo o nome e o valor correspondente a cada item (débito ou crédito)
* soma o valor em uma variável auxiliar
* escreve ao final o total de débitos ou de créditos, dependendo de qual lista você mandou totalizar.

Publicado emAprendendoCEstrutura de Dados

7.773 Comentários

  1. sportwetten schweiz steuern

    Also visit my page: basketball wetten anbieter aus bewertungskriterien?
    (Reda)

  2. AlfredoSougs AlfredoSougs

    В статье по вопросам здоровья мы рассматриваем актуальные проблемы, с которыми сталкивается общество. Обсуждаются заболевания, факторы риска и важные аспекты профилактики. Читатели получат полезные советы о том, как сохранить здоровье и улучшить качество жизни.
    Прочитать подробнее – наркологический центр нижний новгород

  3. Scottbealk Scottbealk

    В данной публикации мы поговорим о процессе восстановления от зависимости, о том, как вернуть себе нормальную жизнь. Мы обсудим преодоление трудностей, значимость поддержки и наличие программ реабилитации. Читатели смогут узнать о ключевых шагах к успешному восстановлению.
    Только для своих – капельница на дом от похмелья

  4. Michaelisoks Michaelisoks

    Эта публикация исследует взаимосвязь зависимости и психологии. Мы обсудим, как психологические аспекты влияют на появление зависимостей и процесс выздоровления. Читатели смогут понять важность профессиональной поддержки и применения научных подходов в терапии.
    Изучить материалы по теме – нарколог на дом круглосуточно цены

  5. DonaldILLED DonaldILLED

    Эта публикация содержит ценные советы и рекомендации по избавлению от зависимости. Мы обсуждаем различные стратегии, которые могут помочь в процессе выздоровления и важность обращения за помощью. Читатели смогут использовать полученные знания для улучшения своего состояния.
    Читать полностью – наркологическая клиника в нижнем новгороде

  6. RonaldIsode RonaldIsode

    В этой статье рассматривается комплексный подход к избавлению от зависимости. Читатель узнает, как сочетание физического, психологического и духовного восстановления помогает достичь стойкого выздоровления.
    Узнать больше – наркологический центр нижний новгород

  7. Joshuawrada Joshuawrada

    Публикация знакомит читателей с различными подходами к реабилитации. От традиционных методов до современных программ — вы узнаете, как выбрать оптимальный путь к выздоровлению и преодолеть препятствия на этом пути.
    Прочесть всё о… – наркологический стационар

  8. Okay seriously, let me save you from the Miami rental nightmare once and for all. You find this amazing offer online — beautiful car, great rate, everything seems perfect. Plus they put a $3500 hold on your card and say “it’ll drop off in 7-10 days”. Honestly, I’m tired of this nonsense. luxury car rental miami florida. Miami without real wheels is basically a slow death. Design District shopping, late-night South Beach cruising, or a spontaneous Keys trip — AC must be freezing and unlimited miles or walk. most are just pretty websites hiding the same old garbage. Finally found one that actually keeps its word. Here’s the only honest place for premium rentals across South Florida
    rolls royce cullinan for rent near me rolls royce cullinan for rent near me also bring good sunglasses unless you like driving blind. Anyway glad someone’s still honest in this business.

  9. That is very interesting, You are a very skilled blogger.
    I have joined your rss feed and stay up for searching for more of your wonderful post.
    Additionally, I have shared your website betting on multiple horses in one race​; Gracie,
    my social networks

  10. Okay real talk — Miami rentals are a minefield and someone needs to say it. Then you actually go to pick it up. Completely different car waiting — bald tires, smell like someone lived in it, and that “fair rate”? Doesn’t include the mandatory $45 daily toll pass or the $350 “location fee” they spring on you. Fool me eighteen times? That’s just the 305 way of life. When you need a reliable luxury car rental miami. anyone who’s tried the trolley knows the struggle. South Beach night out, Design District shopping, or a spontaneous Keys trip — AC must be arctic and unlimited miles non-negotiable. I’ve tested so many rental companies I’ve honestly lost count. what you book is what shows up, period. Here’s the only honest source for premium rides across South Florida
    car rental near miami beach https://luxury-car-rental-miami-18.com Yeah parking in Wynwood will cost you — but that’s Miami for you. drive safe and skip that “windshield protection” upsell.

  11. I’ve paid my dues so you don’t have to. You spot this killer offer online — brand new Porsche, zero excess, price that screams “book me”. Plus they freeze $5500 on your card and say “it’ll drop off in two weeks”. Twenty years in South Florida and these clowns still almost get me. luxury car for rent. anyone who’s tried public transport here knows I’m not joking. leather seats that won’t weld to your legs in July. most are shiny garbage with fake five-star reviews from God knows where. Finally found one outfit that actually keeps its word. prices change hourly so don’t wait around:
    porsche for rent near me https://luxury-car-rental-miami-20.com also bring polarized shades unless you enjoy driving into the sun like a zombie. drive safe and absolutely skip that “windshield protection” upsell — pure profit for them, zero for you.

  12. RonaldIsode RonaldIsode

    В этой статье рассматриваются актуальные вопросы, связанные с развитием медицинской науки и её внедрением в повседневную практику. Особое внимание уделено вопросам профилактики, ранней диагностики и использованию технологий для улучшения здоровья человека.
    Тыкай сюда — узнаешь много интересного – наркологическая клиника

  13. Been through enough garbage to last a lifetime. You spot a tempting offer online: brand new Porsche, unlimited miles, price that makes you click instantly. Plus they lock up $3500 on your card for who knows how long. Ten years in South Florida and these jokers still almost catch me slipping. luxury car rental miami florida. Miami without solid wheels is basically a punishment. South Beach night out, Bal Harbour shopping spree, or a spontaneous Keys adventure — AC must be ice cold and unlimited miles non-negotiable. I’ve run through maybe 55 rental companies across Dade, Broward, and Palm Beach. Finally found one outfit that actually delivers what’s promised. Here’s the only straight shooter for premium rides across South Florida
    luxury car rental miami south beach luxury car rental miami south beach also bring quality shades unless you enjoy driving into the sun like a vampire. drive safe and absolutely skip that “paint protection” upsell — pure robbery.

  14. DonaldILLED DonaldILLED

    Этот обзор посвящен успешным стратегиям избавления от зависимости, включая реальные примеры и советы. Мы разоблачим мифы и предоставим читателям достоверную информацию о различных подходах. Получите опыт многообразия методов и найдите подходящий способ для себя!
    Провести детальное исследование – наркологическая клиника

  15. I’ve got the horror stories to back that up. Then you actually show up to get the keys. Plus they put a $5000 hold on your card and say “don’t worry about it”. Nineteen years in South Florida and these tricks still surprise me. luxury car for rent. Miami without proper wheels is basically a nightmare. Key Biscayne sunset, Bal Harbour shopping, or a spontaneous drive down to Homestead — AC must freeze your face off and unlimited miles or no deal. most are shiny garbage with fake five-star reviews. Finally found one outfit that actually delivers. prices change daily so check it out:
    south beach exotic rentals south beach exotic rentals also bring quality shades unless you like driving into the sun. drive safe and skip that “tire protection” upsell — total waste.

  16. Scottbealk Scottbealk

    Этот обзор медицинских исследований собрал самое важное из последних публикаций в области медицины. Мы проанализировали ключевые находки и представили их в доступной форме, чтобы читатели могли легко ориентироваться в актуальных темах. Этот материал станет отличным подспорьем для изучения медицины.
    Давай разберёмся досконально – капельница от похмелья на дому стоимость

  17. Let me drop some hard truth about the Miami rental game — it’s an absolute circus out here. Then you actually roll up to the lot. Plus they lock up $5500 on your card and say “it’ll drop off in 10-14 business days”. Fool me fourteen times? That’s just the 305 experience at this point. miami car rental luxury — run far from the airport counters. Miami without real wheels is basically a punishment. leather seats that won’t weld themselves to your thighs in July. most are shiny garbage with fake five-star reviews bought from some online marketplace. what you book is what shows up, period, end of discussion. rates change hourly so check before the weekend crowd cleans them out:
    luxury car rental coral gables miami https://luxury-car-rental-miami-14.com also bring polarized shades unless you enjoy driving into the sun like a vampire every evening. Anyway glad there’s at least one straight operator left in this rental jungle.

  18. GeraldSob GeraldSob

    Медицинская публикация представляет собой свод актуальных исследований, экспертных мнений и новейших достижений в сфере здравоохранения. Здесь вы найдете информацию о новых методах лечения, прорывных технологиях и их практическом применении. Мы стремимся сделать актуальные медицинские исследования доступными и понятными для широкой аудитории.
    Смотрите также… – психиатр нарколог на дом в москве

  19. Для тех, кто ищет информацию по теме “Эмоции и стратегические тайны футбольных арен”, есть отличная статья.

    Смотрите сами:

    https://manchesterfan.ru

  20. DavidWrica DavidWrica

    Эта публикация исследует взаимосвязь зависимости и психологии. Мы обсудим, как психологические аспекты влияют на появление зависимостей и процесс выздоровления. Читатели смогут понять важность профессиональной поддержки и применения научных подходов в терапии.
    Погрузиться в детали – наркологическая клиника в нижнем новгороде

  21. Alright, last one I swear — but someone’s gotta warn people about this Miami rental mess. Then you actually go to pick up the car. Different car waiting — dents everywhere, smells like cheap air freshener covering something worse, and that “killer price”? Doesn’t include the mandatory $55 daily toll pass or the $450 “convenience fee” they invent at checkout. Fool me twenty times? That’s just called Tuesday in the 305. luxury car rental miami florida. Miami without real wheels is basically a disaster. South Beach dinner, Design District shopping, or a spontaneous Keys adventure — AC must be arctic and unlimited miles non-negotiable. I’ve tested so many rental companies across Dade, Broward, and Palm Beach. Finally found one outfit that actually keeps its word. prices change hourly so don’t wait around:
    south beach exotic car rentals south beach exotic car rentals Yeah parking in South Beach will cost you a nice bottle of wine — but that’s the Miami tax. drive safe and absolutely skip that “windshield protection” upsell — pure profit for them, zero for you.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *