SlideShare a Scribd company logo
1 of 7
Problema de los peces
#include <iostream>
using namespace std;
int main()
{
int totalfish, id;
double average, p1, p2, p3, p4, p5, totalweight;
cout << "Fisherman, give me your id: ";
cin >> id;
cout << "How many fish did you fish? ";
cin >> totalfish;
cout << "What is the weight of the first fish in pounds? ";
cin >> p1;
cout << "What is the weight of the second fish in pounds? ";
cin >> p2;
cout << "What is the weight of the third fish in pounds? ";
cin >> p3;
cout << "What is the weight of the fourth fish in pounds? ";
cin >> p4;
cout << "What is the weight of the fifth fish in pounds? ";
cin >> p5;
totalweight= (p1+p2+p3+p4+p5)/2;
cout << "The total weight in kilos is: " <<totalweight<<endl;
average= (totalweight*2)/5;
cout << "The result of the average is: " <<average;
return 0;
}
cpp.sh/7f5y
1. Ask a person to enter 3 random numbers, then ask another person to enter
other 3 random numbers, calculate the average of each person and a final
average for both people. show each result
#include <iostream>
using namespace std;
int main ()
{
double x, y, z, a, b, c;
double average1, average2, averaget;
cout << "The following 3 number are from the first person: ";
cout << "Give me the first number: ";
cin >> x;
cout << "Give me the second number: ";
cin >> y;
cout << "Give me the third number: ";
cin >> z;
cout << "The following 3 number are from the second person: ";
cout << "Give me the first number: ";
cin >> a;
cout << "Give me the second number: ";
cin >> b;
cout << "Give me the third number: ";
cin >> c;
average1= (x+y+z)/3;
average2= (a+b+c)/3;
averaget= (average1+average2)/2;
cout << "The average of the number of the first person is: " <<average1<<endl;
cout << "The average of the number of the second person is: " <<average2<<endl;
cout << "The final average for both people is: " <<averaget;
return 0;
}
cpp.sh/62y3t
2. Ask an employee how many hours does he work per week and how much he
gets paid per hour, calculate the gross salary (salario bruto- horas trabajas x
valor hora), how much he gets in deductions (4% health, 4% pension), net
salary (salario neto- salario bruto menos deducciones) show each result.
#include <iostream>
using namespace std;
int main ()
{
double horas, pago;
double sb, ds, dp, sn;
cout << "How many hours do you work per week? ";
cin >> horas;
cout << "How much do you get paid per hour? ";
cin >> pago;
sb= horas*pago;
ds= 0.04*sb;
dp= 0.04*sb;
sn= sb-(ds+dp);
cout << "The gross salary is: " <<sb<<endl;
cout << "The health deductions are: " <<ds<<endl;
cout << "The pension deductions are: " <<dp<<endl;
cout << "The net salary is: " <<sn;
return 0;
}
cpp.sh/4ysms
3. Ask a person how much money he/she has in his/her bank account, calculate
an interest of 3% for that amount of money. Each month he/she receives that
interest in his account. How much money will he/she have after 8 months?
Show the result
#include <iostream>
using namespace std;
int main ()
{
double money;
double interesm, interes8, dinerot;
cout << "How much money do you have in your bank account? ";
cin >> money;
interesm= money*0.03;
interes8= interesm*8;
dinerot= interes8+money;
cout << "The interest per month in your account will be: " <<interesm<<endl;
cout << "After 8 months, the total of interests that you will receive is: "
<<interes8<<endl;
cout << "The total money, after 8 months will be: " <<dinerot;
return 0;
}
cpp.sh/5aor
4.. Ask a person how much money he/she has in his/her bank account. Tell him
to make a deposit (add money) and a withdraw ( extract money). Calculate the
final balance after the deposit and the withdraw.
Show the result
#include <iostream>
using namespace std;
int main ()
{
double money, d, r;
double moneyt;
cout << "How much money do you have in your bank account? ";
cin >> money;
cout << "How much money are you going to deposit in your account? ";
cin >> d;
cout << "How much money are you going to withdraw from your account? ";
cin >> r;
moneyt= money+d-r;
cout << "The final balance in your bank account is: " <<moneyt;
return 0;
}
cpp.sh/7hc5
Conditionals
1. ¿Qué clase de triángulo es?
#include <iostream>
using namespace std;
int main()
{
int lado1, lado2, lado3;
cout<< "El primer lado mide ";
cin>> lado1;
cout<< "El segundo lado mide ";
cin>> lado2;
cout<< "El tercer lado mide ";
cin>> lado3;
if ((lado1==lado2)&&(lado2==lado3)&&(lado1==lado3))
{
cout<<"El triangulo es equilatero " <<endl;
}
if ((lado1!=lado2)&&(lado2!=lado3)&&(lado1!=lado3))
{
cout<< "El triangulo es escaleno" <<endl;
}
else
{
cout<<"El triangulo es isosceles" <<endl;
}
}
cpp.sh/4ubh
2. Notas de estudiantes
#include <iostream>
using namespace std;
int main ()
{
int score;
cout << "Give me your score: ";
cin >> score;
if ((score>=90) && (score<=100))
{
cout << "You got an A" <<endl;
}
if ((score>=80) && (score<=89))
{
cout << "You got a B" <<endl;
}
if ((score>=70) && (score<=79))
{
cout << "You got a C" <<endl;
}
if ((score>=60) && (score<=69))
{
cout << "You got a D" <<endl;
}
if ((score>=0) && (score<=59))
{
cout << "You got a F" <<endl;
}
}
cpp.sh/5sn7

More Related Content

Viewers also liked (19)

Paper6
Paper6Paper6
Paper6
 
Informatica
InformaticaInformatica
Informatica
 
Master thesis final_Lene Mi Ran Kristiansen
Master thesis final_Lene Mi Ran KristiansenMaster thesis final_Lene Mi Ran Kristiansen
Master thesis final_Lene Mi Ran Kristiansen
 
Informatica
InformaticaInformatica
Informatica
 
2ºb inf
2ºb inf2ºb inf
2ºb inf
 
3ºb inf.
3ºb inf.3ºb inf.
3ºb inf.
 
1510 Presskit_current
1510 Presskit_current1510 Presskit_current
1510 Presskit_current
 
Lesson2 v2004
Lesson2 v2004Lesson2 v2004
Lesson2 v2004
 
Acquired immunodeficiency syndrome(aids)
Acquired immunodeficiency syndrome(aids)Acquired immunodeficiency syndrome(aids)
Acquired immunodeficiency syndrome(aids)
 
Sysmex xe-5000
Sysmex xe-5000Sysmex xe-5000
Sysmex xe-5000
 
diagnosis of intestinal protozoa
diagnosis of intestinal protozoadiagnosis of intestinal protozoa
diagnosis of intestinal protozoa
 
Homeopathy
HomeopathyHomeopathy
Homeopathy
 
La ballena azul
La ballena azulLa ballena azul
La ballena azul
 
Enaknya Jadi Jurnalis
Enaknya Jadi Jurnalis Enaknya Jadi Jurnalis
Enaknya Jadi Jurnalis
 
1ºc prim
1ºc prim1ºc prim
1ºc prim
 
Aviva
AvivaAviva
Aviva
 
Introducción a responsive design. Cómo adaptar tu web a móviles y tablets
Introducción a responsive design. Cómo adaptar tu web a móviles y tabletsIntroducción a responsive design. Cómo adaptar tu web a móviles y tablets
Introducción a responsive design. Cómo adaptar tu web a móviles y tablets
 
Mi Clase de 1ºA pimaria
Mi Clase de 1ºA pimariaMi Clase de 1ºA pimaria
Mi Clase de 1ºA pimaria
 
Biblioteca
BibliotecaBiblioteca
Biblioteca
 

Similar to Programación

Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solvingSyed Umair
 
Powerpoint loop examples a
Powerpoint loop examples aPowerpoint loop examples a
Powerpoint loop examples ajaypeebala
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control StructureMohammad Shaker
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.pptLokeshK66
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd marchRajeev Sharan
 
for this particular program how do i create the input innotepad 1st ?#include...
for this particular program how do i create the input innotepad 1st ?#include...for this particular program how do i create the input innotepad 1st ?#include...
for this particular program how do i create the input innotepad 1st ?#include...hwbloom14
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
for this particular program how do i create the input innotepad 1st ? #includ...
for this particular program how do i create the input innotepad 1st ? #includ...for this particular program how do i create the input innotepad 1st ? #includ...
for this particular program how do i create the input innotepad 1st ? #includ...hwbloom59
 

Similar to Programación (20)

Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
Project in programming
Project in programmingProject in programming
Project in programming
 
Powerpoint loop examples a
Powerpoint loop examples aPowerpoint loop examples a
Powerpoint loop examples a
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
10 template code program
10 template code program10 template code program
10 template code program
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control Structure
 
C++ TUTORIAL 2
C++ TUTORIAL 2C++ TUTORIAL 2
C++ TUTORIAL 2
 
Struct
StructStruct
Struct
 
ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.ppt
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
for this particular program how do i create the input innotepad 1st ?#include...
for this particular program how do i create the input innotepad 1st ?#include...for this particular program how do i create the input innotepad 1st ?#include...
for this particular program how do i create the input innotepad 1st ?#include...
 
Algoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.lAlgoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.l
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
C++ programming
C++ programmingC++ programming
C++ programming
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
for this particular program how do i create the input innotepad 1st ? #includ...
for this particular program how do i create the input innotepad 1st ? #includ...for this particular program how do i create the input innotepad 1st ? #includ...
for this particular program how do i create the input innotepad 1st ? #includ...
 
Coding gaji
Coding gajiCoding gaji
Coding gaji
 

More from Luci2013

Preparación de proyecto
Preparación de proyectoPreparación de proyecto
Preparación de proyectoLuci2013
 
Proyecto emprendimiento
Proyecto emprendimientoProyecto emprendimiento
Proyecto emprendimientoLuci2013
 
Bimestral emprendimiento
Bimestral emprendimientoBimestral emprendimiento
Bimestral emprendimientoLuci2013
 
Emprendimiento escuelas teoricas, contexto y conceptos (1)(1)
Emprendimiento   escuelas teoricas, contexto y conceptos (1)(1)Emprendimiento   escuelas teoricas, contexto y conceptos (1)(1)
Emprendimiento escuelas teoricas, contexto y conceptos (1)(1)Luci2013
 
Documento1
Documento1Documento1
Documento1Luci2013
 
Bimestral tecnología y emprendimiento
Bimestral tecnología y emprendimientoBimestral tecnología y emprendimiento
Bimestral tecnología y emprendimientoLuci2013
 
Dirección de las compañías
Dirección de las compañíasDirección de las compañías
Dirección de las compañíasLuci2013
 
Dirección de las compañías
Dirección de las compañíasDirección de las compañías
Dirección de las compañíasLuci2013
 
Temas cuarto periodo
Temas cuarto periodoTemas cuarto periodo
Temas cuarto periodoLuci2013
 
Simulaciones
SimulacionesSimulaciones
SimulacionesLuci2013
 
Movie maker
Movie makerMovie maker
Movie makerLuci2013
 
Salud ocupacional imágenes
Salud ocupacional imágenesSalud ocupacional imágenes
Salud ocupacional imágenesLuci2013
 
Actividad tercer periodo
Actividad tercer periodoActividad tercer periodo
Actividad tercer periodoLuci2013
 
Actividad tercer periodo
Actividad tercer periodoActividad tercer periodo
Actividad tercer periodoLuci2013
 
Apareamiento corel
Apareamiento corelApareamiento corel
Apareamiento corelLuci2013
 
Bimestral tecnología 1
Bimestral tecnología 1Bimestral tecnología 1
Bimestral tecnología 1Luci2013
 
Excel 2013
Excel 2013Excel 2013
Excel 2013Luci2013
 
Bimestral primer periodo
Bimestral primer periodoBimestral primer periodo
Bimestral primer periodoLuci2013
 
Taller decisiones bajo riesgo
Taller decisiones bajo riesgoTaller decisiones bajo riesgo
Taller decisiones bajo riesgoLuci2013
 

More from Luci2013 (20)

Preparación de proyecto
Preparación de proyectoPreparación de proyecto
Preparación de proyecto
 
Proyecto emprendimiento
Proyecto emprendimientoProyecto emprendimiento
Proyecto emprendimiento
 
Bimestral emprendimiento
Bimestral emprendimientoBimestral emprendimiento
Bimestral emprendimiento
 
Emprendimiento escuelas teoricas, contexto y conceptos (1)(1)
Emprendimiento   escuelas teoricas, contexto y conceptos (1)(1)Emprendimiento   escuelas teoricas, contexto y conceptos (1)(1)
Emprendimiento escuelas teoricas, contexto y conceptos (1)(1)
 
Documento1
Documento1Documento1
Documento1
 
Economía
EconomíaEconomía
Economía
 
Bimestral tecnología y emprendimiento
Bimestral tecnología y emprendimientoBimestral tecnología y emprendimiento
Bimestral tecnología y emprendimiento
 
Dirección de las compañías
Dirección de las compañíasDirección de las compañías
Dirección de las compañías
 
Dirección de las compañías
Dirección de las compañíasDirección de las compañías
Dirección de las compañías
 
Temas cuarto periodo
Temas cuarto periodoTemas cuarto periodo
Temas cuarto periodo
 
Simulaciones
SimulacionesSimulaciones
Simulaciones
 
Movie maker
Movie makerMovie maker
Movie maker
 
Salud ocupacional imágenes
Salud ocupacional imágenesSalud ocupacional imágenes
Salud ocupacional imágenes
 
Actividad tercer periodo
Actividad tercer periodoActividad tercer periodo
Actividad tercer periodo
 
Actividad tercer periodo
Actividad tercer periodoActividad tercer periodo
Actividad tercer periodo
 
Apareamiento corel
Apareamiento corelApareamiento corel
Apareamiento corel
 
Bimestral tecnología 1
Bimestral tecnología 1Bimestral tecnología 1
Bimestral tecnología 1
 
Excel 2013
Excel 2013Excel 2013
Excel 2013
 
Bimestral primer periodo
Bimestral primer periodoBimestral primer periodo
Bimestral primer periodo
 
Taller decisiones bajo riesgo
Taller decisiones bajo riesgoTaller decisiones bajo riesgo
Taller decisiones bajo riesgo
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Programación

  • 1. Problema de los peces #include <iostream> using namespace std; int main() { int totalfish, id; double average, p1, p2, p3, p4, p5, totalweight; cout << "Fisherman, give me your id: "; cin >> id; cout << "How many fish did you fish? "; cin >> totalfish; cout << "What is the weight of the first fish in pounds? "; cin >> p1; cout << "What is the weight of the second fish in pounds? "; cin >> p2; cout << "What is the weight of the third fish in pounds? "; cin >> p3; cout << "What is the weight of the fourth fish in pounds? "; cin >> p4; cout << "What is the weight of the fifth fish in pounds? "; cin >> p5; totalweight= (p1+p2+p3+p4+p5)/2; cout << "The total weight in kilos is: " <<totalweight<<endl; average= (totalweight*2)/5; cout << "The result of the average is: " <<average; return 0; } cpp.sh/7f5y
  • 2. 1. Ask a person to enter 3 random numbers, then ask another person to enter other 3 random numbers, calculate the average of each person and a final average for both people. show each result #include <iostream> using namespace std; int main () { double x, y, z, a, b, c; double average1, average2, averaget; cout << "The following 3 number are from the first person: "; cout << "Give me the first number: "; cin >> x; cout << "Give me the second number: "; cin >> y; cout << "Give me the third number: "; cin >> z; cout << "The following 3 number are from the second person: "; cout << "Give me the first number: "; cin >> a; cout << "Give me the second number: "; cin >> b; cout << "Give me the third number: "; cin >> c; average1= (x+y+z)/3; average2= (a+b+c)/3; averaget= (average1+average2)/2; cout << "The average of the number of the first person is: " <<average1<<endl; cout << "The average of the number of the second person is: " <<average2<<endl; cout << "The final average for both people is: " <<averaget; return 0; } cpp.sh/62y3t
  • 3. 2. Ask an employee how many hours does he work per week and how much he gets paid per hour, calculate the gross salary (salario bruto- horas trabajas x valor hora), how much he gets in deductions (4% health, 4% pension), net salary (salario neto- salario bruto menos deducciones) show each result. #include <iostream> using namespace std; int main () { double horas, pago; double sb, ds, dp, sn; cout << "How many hours do you work per week? "; cin >> horas; cout << "How much do you get paid per hour? "; cin >> pago; sb= horas*pago; ds= 0.04*sb; dp= 0.04*sb; sn= sb-(ds+dp); cout << "The gross salary is: " <<sb<<endl; cout << "The health deductions are: " <<ds<<endl; cout << "The pension deductions are: " <<dp<<endl; cout << "The net salary is: " <<sn; return 0; } cpp.sh/4ysms
  • 4. 3. Ask a person how much money he/she has in his/her bank account, calculate an interest of 3% for that amount of money. Each month he/she receives that interest in his account. How much money will he/she have after 8 months? Show the result #include <iostream> using namespace std; int main () { double money; double interesm, interes8, dinerot; cout << "How much money do you have in your bank account? "; cin >> money; interesm= money*0.03; interes8= interesm*8; dinerot= interes8+money; cout << "The interest per month in your account will be: " <<interesm<<endl; cout << "After 8 months, the total of interests that you will receive is: " <<interes8<<endl; cout << "The total money, after 8 months will be: " <<dinerot; return 0; } cpp.sh/5aor
  • 5. 4.. Ask a person how much money he/she has in his/her bank account. Tell him to make a deposit (add money) and a withdraw ( extract money). Calculate the final balance after the deposit and the withdraw. Show the result #include <iostream> using namespace std; int main () { double money, d, r; double moneyt; cout << "How much money do you have in your bank account? "; cin >> money; cout << "How much money are you going to deposit in your account? "; cin >> d; cout << "How much money are you going to withdraw from your account? "; cin >> r; moneyt= money+d-r; cout << "The final balance in your bank account is: " <<moneyt; return 0; } cpp.sh/7hc5
  • 6. Conditionals 1. ¿Qué clase de triángulo es? #include <iostream> using namespace std; int main() { int lado1, lado2, lado3; cout<< "El primer lado mide "; cin>> lado1; cout<< "El segundo lado mide "; cin>> lado2; cout<< "El tercer lado mide "; cin>> lado3; if ((lado1==lado2)&&(lado2==lado3)&&(lado1==lado3)) { cout<<"El triangulo es equilatero " <<endl; } if ((lado1!=lado2)&&(lado2!=lado3)&&(lado1!=lado3)) { cout<< "El triangulo es escaleno" <<endl; } else { cout<<"El triangulo es isosceles" <<endl; } } cpp.sh/4ubh
  • 7. 2. Notas de estudiantes #include <iostream> using namespace std; int main () { int score; cout << "Give me your score: "; cin >> score; if ((score>=90) && (score<=100)) { cout << "You got an A" <<endl; } if ((score>=80) && (score<=89)) { cout << "You got a B" <<endl; } if ((score>=70) && (score<=79)) { cout << "You got a C" <<endl; } if ((score>=60) && (score<=69)) { cout << "You got a D" <<endl; } if ((score>=0) && (score<=59)) { cout << "You got a F" <<endl; } } cpp.sh/5sn7