SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
Java Básico
Exercícios
Hello Word
• A aplicação deve exibir no console os dizeres: “Hello
Word”.

• A aplicação deve encerrar com sucesso em seguida.
Calculando horas
• A aplicação deve realizar as seguintes conversões de minutos para horas:

1. 60 minutos

2. 5 minutos

3. 55 minutos

4. 99 minutos

5. 110 minutos

6. 1450 minutos

• A lógica de exibição dos resultados deverá ser:

A. Se a conversão resultar em uma hora exata, exibir o resultado como: 1 hora, 2 horas, 3 horas. Atenção para o plural!

B. Se a conversão resultar em um valor inferior a uma hora completa, deverá exibir os valores em minutos, como: 1
minuto, 20 minutos, 30 minutos.

C. Se a conversão resultar em um valor superior a uma hora completa, sendo um valor não exato, deverá exibir a hora
abreviada, conforme os exemplos: 1h 20 min, 3h 10 min.

D. Se os minutos resultantes da conversão não exata forem superiores a 3/4 de hora, deverá ser exibido a quantidade de
minutos faltantes para a próxima hora completa. Exemplo: 75 minutos ficaram “1h 15 min”, já 175 minutos ficariam “5
min para 3 h"
Lista de Nomes
• A aplicação deverá receber em seu método principal uma
lista de nomes.

• A aplicação deverá varrer a lista buscando por nomes
repetidos. 

• Caso encontre algum nome repetido, deverá exibi-lo
como: “Fulano encontra-se em duplicidade”

• Caso não haja nenhum nome repetido, deverá exibir a
mensagem “Registros verificados com sucesso”
Jogando cartas
• A aplicação deve possuir os seguintes Modelos:

1. Jogador

2. Carta

• Cada jogador terá um nome, um identificador (ex: Jogador 1, 2, 3) e 3 cartas.

• Cada carta terá um valor de 1 a 10.

• Cada jogador receberá 3 cartas aleatórias.

• Cada jogador terá uma ação jogar, que selecionará uma carta aleatória das suas cartas, e colocará em jogo; assim como uma
ação receber carta, que adicionará uma carta à sua mão.

• A aplicação deve realizar a jogada de cada um dos jogadores, e, em seguida, verificar quem foi o ganhador.

• O ganhador é aquele que tirou a carta maior.

• No final, a aplicação deve exibir as seguintes mensagens no console:

A. Jogador X: 6

B. Jogador Y: 9

C. Ganhador: Jogador Y

Mais conteúdo relacionado

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Java Básico - Exercícios

  • 2. Hello Word • A aplicação deve exibir no console os dizeres: “Hello Word”. • A aplicação deve encerrar com sucesso em seguida.
  • 3. Calculando horas • A aplicação deve realizar as seguintes conversões de minutos para horas: 1. 60 minutos 2. 5 minutos 3. 55 minutos 4. 99 minutos 5. 110 minutos 6. 1450 minutos • A lógica de exibição dos resultados deverá ser: A. Se a conversão resultar em uma hora exata, exibir o resultado como: 1 hora, 2 horas, 3 horas. Atenção para o plural! B. Se a conversão resultar em um valor inferior a uma hora completa, deverá exibir os valores em minutos, como: 1 minuto, 20 minutos, 30 minutos. C. Se a conversão resultar em um valor superior a uma hora completa, sendo um valor não exato, deverá exibir a hora abreviada, conforme os exemplos: 1h 20 min, 3h 10 min. D. Se os minutos resultantes da conversão não exata forem superiores a 3/4 de hora, deverá ser exibido a quantidade de minutos faltantes para a próxima hora completa. Exemplo: 75 minutos ficaram “1h 15 min”, já 175 minutos ficariam “5 min para 3 h"
  • 4. Lista de Nomes • A aplicação deverá receber em seu método principal uma lista de nomes. • A aplicação deverá varrer a lista buscando por nomes repetidos. • Caso encontre algum nome repetido, deverá exibi-lo como: “Fulano encontra-se em duplicidade” • Caso não haja nenhum nome repetido, deverá exibir a mensagem “Registros verificados com sucesso”
  • 5. Jogando cartas • A aplicação deve possuir os seguintes Modelos: 1. Jogador 2. Carta • Cada jogador terá um nome, um identificador (ex: Jogador 1, 2, 3) e 3 cartas. • Cada carta terá um valor de 1 a 10. • Cada jogador receberá 3 cartas aleatórias. • Cada jogador terá uma ação jogar, que selecionará uma carta aleatória das suas cartas, e colocará em jogo; assim como uma ação receber carta, que adicionará uma carta à sua mão. • A aplicação deve realizar a jogada de cada um dos jogadores, e, em seguida, verificar quem foi o ganhador. • O ganhador é aquele que tirou a carta maior. • No final, a aplicação deve exibir as seguintes mensagens no console: A. Jogador X: 6 B. Jogador Y: 9 C. Ganhador: Jogador Y