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

12.144 Comentários

  1. Люди подскажите Ситуация критическая Дети напуганы Таблетки не помогают Короче, врач приехал и поставил систему — наркологическая помощь на дому круглосуточно качественно Через пару часов человек пришёл в себя В общем, жмите чтобы сохранить — нарколог домой нарколог домой Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  2. Добрый день!
    Автоматическая SEO система продвижение сайтов исключает человеческий фактор и ошибки ручного труда. Мы используем скрипты для мониторинга позиций и проверки доступности сайта круглосуточно. Это позволяет мгновенно реагировать на технические сбои или падения позиций в выдаче. Данные собираются в единую панель управления для удобного анализа эффективности работы. Экономьте время менеджеров и повышайте точность отчетности с помощью наших технологий.
    Самая точная информация на сайте – https://linkbooster.space/
    раскрутка сайтов заказать, продвижение сайта онлайн, продвижение сайта воронеж
    сеть продвижение сайта, продвижение сайтов в яндексе москва, продвижение сайта стоимость
    Всего наилучшего и роста в топе!

  3. OK — have been messing about with this thing for maybe a few months now and it’s stuck on my phone, so thought I’d chuck my thoughts in since a lad on another thread asked me the other day. I’m in the UK, generally stick to footie and the horses, a fiver here and there, so take it how you like.

    The reason I started using it was actually pretty stupid — I never could work out what an each way return actually was with 1/5 odds a place. I’d just wing it and moan when the payout landed. Now type the odds in before I place anything, even a simple single bet.

    The single bet calculator is the bit I open most — you put in stake and odds and it shows profit and total return with no faffing, fractional or decimal, doesn’t matter. Same tool covers the bigger stuff — doubles and trebles returns, lucky 15s, yankees, which is where I’d always got it wrong. If you fancy a poke about, it’s here heinz bet calculator and it’s free with no account nonsense.

    One thing that genuinely changed how I bet was the geekier tools. The implied probability thing that shows the overround, plus a kelly criterion tool — I use half kelly since full stakes are far too aggressive. The dutching one is handy too for when I’m spreading across selections.

    Not all sunshine though. The design is pretty plain — no polish, which honestly I don’t mind but some will. On my phone it’s usable though the lucky 63 breakdown need a bit of scrolling. And nothing on the app store, it’s a website and that’s it — slight shame but you asked.

    Right, that’s me. Doesn’t cost anything, not plastered in adverts, works. If anyone honestly does the maths on paper, have a look — it’s saved me a load of arguments with the bookie.

  4. Right — have been messing about with this thing for maybe five months now and it’s stuck on my phone, so figured I’d chuck my thoughts in since a lad on another thread asked me last week. I’m based in the UK, mostly stick to footie and the horses, a fiver here and there, so take it how you like.

    What got me on it was genuinely pretty stupid — I couldn’t ever figure out what an ew return actually was once you get five places instead of three. I’d just guess and moan when the payout landed. Now punch the numbers in before every slip, even a simple single bet.

    The single bet calculator is the bit I open most — you put in the price and your stake and it shows profit and total return with no faffing, fractions or decimals. Same tool covers the fiddly ones — doubles and trebles returns, lucky 15s, yankees, which is where most people I know lose track. If you fancy a poke about, it lives at spread betting margin calculator and it’s free with no account nonsense.

    One thing that genuinely shifted things for me were the geekier tools. They’ve got an odds-to-probability converter which shows you how much the bookie’s taking, and a kelly criterion calculator — I use half kelly because full kelly is a quick route to a dead bankroll. The dutching one gets used a fair bit for when I’m covering two or three runners.

    Not all sunshine though. The interface is a bit basic — not much flash, which honestly I don’t mind but some will. Phone-wise it’s fine though the lucky 63 breakdown are a squeeze. Also there’s nothing on the app store, it’s a website and that’s it — doesn’t bother me just flagging it.

    So yeah. Free, no ads shoved in your face, works. If you still works out returns on a calculator app, have a look — saves me a fair few dumb bets I’d have regretted.

  5. Люди помогите советом Близкий человек уже несколько дней в запое Жена в истерике Нужен врач прямо сейчас Короче, единственный кто реально помог — врач нарколог на дом с капельницей Через пару часов человек пришёл в себя В общем, телефон и цены тут — частный нарколог на дом частный нарколог на дом Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  6. Здорова, народ Ситуация критическая Соседи стучат в стену Нужна срочная помощь на дому Короче, только это реально спасло — вывод из запоя самара круглосуточно Через пару часов человек пришёл в себя В общем, телефон и цены тут — вывод из запоя недорого вывод из запоя недорого Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  7. Здорова, народ Брат снова сорвался Жена в истерике В больницу тащить страшно Короче, врачи приехали и поставили систему — вывод из запоя на дому срочно Сняли ломку и стабилизировали состояние В общем, вся инфа по ссылке — вывести из запоя недорого на дому https://kodirovanie.vyvod-iz-zapoya-na-domu-samara.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  8. Hey everyone Some agencies give you scratched-up cars that don’t match the pics Almost gave up on renting high-end cars here These guys are the real deal — luxury cars for rental no deposit required Cruised around South Beach in a Lambo and turned heads everywhere Anyway, all the deets are right here — porsche car rental near me https://www.pinterest.com/pin/1092122978529556712 Don’t fall for those sketchy rental agencies Send this to anyone planning a Miami trip in style

  9. Доброго!
    Продвижение сайта в поисковых системах требует глубокого понимания алгоритмов и специфики ранжирования. Мы работаем одновременно с Яндексом и Google для максимального охвата аудитории. Техническая оптимизация сочетается с грамотной контентной и ссылочной стратегией. Клиент получает регулярные отчёты с динамикой позиций по всем запросам. Продвижение сайта в поисковых системах с нами — путь к стабильному трафику.
    Самая точная информация на сайте – https://linkbooster.space/
    seo продвижение онлайн, продвижения корпоративного сайта, заказать ссылки
    заказать ссылки, крауд маркетинг, поисковое продвижение сайта
    Всего наилучшего и роста в топе!

  10. Привет всем!
    Продвижение сайтов ссылками остаётся эффективным инструментом при грамотном планировании стратегии. Мы подбираем доноров с учётом тематики и авторитетности площадки. Размещение проходит поэтапно, чтобы избежать резких скачков и санкций. Клиент получает регулярную отчётность с полной статистикой размещений. Продвижение сайтов ссылками с нами — баланс безопасности и эффективности.
    Самая подробная информация на сайте – https://linkbooster.space/
    сео продвижение, seo продвижение сайта в интернете, продвижение сайта стоимость
    заказать ссылки, продвижение сайта в 10 яндекса, продвижения корпоративного сайта
    Всего наилучшего и роста в топе!

  11. So — have been messing about with this thing for maybe six months now and it’s stuck on my phone, reckon I’d write something up since a mate asked me the other day. I’m in the UK, generally bet football and racing, small stakes, just so you know where I’m coming from.

    How I found it was genuinely a bit daft — I couldn’t ever figure out what an ew payout actually came to once you get five places instead of three. I used to just eyeball it and then be surprised. Now type the odds in before every slip, even the boring singles.

    The single bet calculator tool is the one I’m on daily — you drop in the price and your stake and it spits out the return instantly, fractional or decimal, doesn’t matter. There’s also the multiples — acca and treble maths, lucky 15 and lucky 63, yankees, which is where I’d always got it wrong. If you fancy a poke about, it’s here single horse bet calculator — free, no signup.

    What genuinely made a difference was the nerdier tools. There’s an probability calculator and it makes obvious what margin’s baked in, and there’s the kelly staking tool — I run quarter kelly as the full version is far too aggressive. The dutching one is handy too for when I’m splitting a race.

    It’s not perfect mind. Its interface feels very functional, let’s say — no flash, looks like it was built by someone who cares more about maths than colours. Phone-wise it’s fine but the acca grid are a squeeze. And nothing on the app store, it’s a website and that’s it — fine by me just flagging it.

    So yeah. Doesn’t cost anything, barely any ads, does what it says. If anyone even now adds it up in their head, have a look — saved me a load of “wait, that’s it?” moments.

Deixe um comentário

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