Função para calcular despesas da viagem para a formação iOS na Stone

Overview

Calcular despesas da viagem

Desafio: Desenvolva uma função (ou método) que irá receber uma lista de despesas (como a detalhada acima) e uma lista de nomes.

A função deve:

● Calcular a soma dos valores, ou seja, multiplicar o preço de cada despesa por sua quantidade e somar todos os resultados.

● Dividir o valor de forma igual entre a quantidade de pessoas.

● Retornar um mapa/dicionário onde a chave será o nome e o valor será quanto ele deve pagar a você.

Como testar

swift main.swift

Modifique os arrays no topo do arquivo main.swift para mudar os parâmetros da função.

Exemplo de resposta

O valor total é 700002
O valor por integrante é 175000
O resto é 2
 
["Braga": 175001, "Carlos": 175001, "Abel": 175000, "Daniel": 175000]
You might also like...
Tweak your iOS app without recompiling!
Tweak your iOS app without recompiling!

SwiftTweaks Adjust your iOS app on the fly without waiting to re-compile! Your users won’t see your animation study, Sketch comps, or prototypes. What

Updeto is a simple package that help update checker for iOS Apps

Updeto is a simple package that will help you to check if the currently installed version is the same as the latest one available on App Store.

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

Recreating a fully functional version of iOS 4 in SwiftUI.
Recreating a fully functional version of iOS 4 in SwiftUI.

Updates: Version 1.0 is currently available 🎉 While I work on fixing an issue in Xcode 12.5+ with LazyVGrid, I recommend you build using Xcode 12.4 a

Helpful extensions for iOS app development 🚀
Helpful extensions for iOS app development 🚀

ExtensionKit includes many extensions, from getting the user location with a deterministic Combine API to a shimmer loading animation, to keyboard notification updates, bottom sheet and much much more. Check out the docs below or install the library with SPM to try it out.

Experimental iOS Arm64 hooking

ClownHook Experimental hooking on Arm64. Status Experimenting Setup Install xcodegen to generate an Xcode project. brew install xcodegen Create the X

Validate iOS, Android, and Mac localizations. Find errors in .strings, .stringsdict, and strings.xml files.

Locheck An Xcode and Android localization file validator. Make sure your .strings, .stringsdict, and strings.xml files do not have any errors! What do

An iOS app/Safari extension to automagically redirect AMP links to their normal counterpart. Comes with a trusty dog.

Amplosion ⚡️ Amplosion is an iOS 15 and greater app that automagically redirects AMP links to their normal counterpart. AMP links can be super annoyin

Read iOS 15 privacy insight '.ndjson' file into your human brain.
Read iOS 15 privacy insight '.ndjson' file into your human brain.

Insight Read iOS 15 privacy insight '.ndjson' file into your human brain. Written in SwiftUI. Feature Compile records into app summary Relink app info

Owner
Gabriela Rodrigues
Gabriela Rodrigues
Record your position and export your trip in GPX with GPS Stone on iOS.

GPS Stone Register your trips and export them as GPX files. Notes We currently have included a UIRequiredDeviceCapabilities with a location-services v

Frost Land 11 Sep 24, 2022
Uma lista de conteúdos para você aprender Swift

Aprenda Swift Esta lista contém diversos links com conteúdos para aprender a desenvolver utilizando a linguagem Swift. Pela escassez de conteúdo em Po

null 556 Dec 30, 2022
Liste é um app para anotar suas tarefas de forma a respeitar sua rotina e suas necessidades

Liste Liste é um app para anotar suas tarefas de forma a respeitar sua rotina e suas necessidades Explore a documentação » TestFlight · Reporte Bug Ta

Danilo Lira 2 Mar 12, 2022
MarvelComics-ViewCode é um app para fins de estudo, desenvolvido em Swift utilizando View Code.

MarvelComics-ViewCode - iOS O MarvelComics-ViewCode é um app para listar todos os personagens da Marvel, implementado em Swift utilizando View Code co

Alan Silva 1 Jun 18, 2022
Ios-mod-extract - iOS mod extract with swift

DIOExtract Example To run the example project, clone the repo, and run pod insta

Victor Freitas 3 Jun 14, 2022
IOS-Bootcamp-Examples - Learn to Swift while building apps - With IOS Development Bootcamp

IOS-Bootcamp-Examples Learn to Swift while building apps - With IOS Development

Bilge Çakar 9 Dec 21, 2022
iOS helper library that contains commonly used code in Uptech iOS projects

iOS helper library that contains commonly used code in Uptech iOS projects.

Uptech 1 Apr 1, 2022
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.

Introduction EtherWalletKit is an Ethereum Wallet Toolkit for iOS. I hope cryptocurrency and decentralized token economy become more widely adapted. H

Sung Woo Chang 136 Dec 25, 2022
Generate a privacy policy for your iOS app

PrivacyFlash Pro To easily run PrivacyFlash Pro get the latest packaged release. Learn more about PrivacyFlash Pro in our research paper. PrivacyFlash

privacy-tech-lab 141 Dec 22, 2022