SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Here is an example compilation and execution of the program: linux3[1]% g + + Wall lab2.cpp -
o lab2 linux3[1]%. / obab How many ints would you like to multiply? 4 Please enter an int ( 1 of
4 ) : 3 Please enter an int ( 2 of 4 ) : 4 Please enter an int ( 3 of 4 ) : 1 Please enter an int (4 of 4 )
: 5 The product of your input ints is: 60 60 is greater than thirty! 10. Programming Assignment
You will practice working with input/output, conditional logic, loops, and functions by adding
code to the 1 ab 2 . cpp template provided. More specifically, you will need to add the function
prototype and body for 2 functions, invoking them in main () as detailed below: - Implement the
function productofints (). - The function should not have any parameters - The user should be
asked to enter the number of ints they want to multiply together. - The user will then enter values
until the number of specified ints is reached. - The function should then print and return the
result of the product of the inputted numbers. - Implement the function lessThanThirty (). - The
function should accept an int as a parameter. - If the passed in argument is less than thirty, the
function should display a message that says it is less or greater than thirty - The function should
not return anything. - Add a function call to productofints () and IessThanThirty () in main (). -
The user should enter their desired amount of numbers, and the program should display the final
value after the operations, as well as if the total is less than thirty or not. - This logic must be
implemented in one line. This means that the main () function can have ONE statement (and the
return 0 ).

Weitere ähnliche Inhalte

Ähnlich wie Here is an example compilation and execution of the program- linux3-1-.docx

JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
vrickens
 
Educational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdfEducational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdf
rajeshjangid1865
 

Ähnlich wie Here is an example compilation and execution of the program- linux3-1-.docx (20)

Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
 
ACM init()- Day 4
ACM init()- Day 4ACM init()- Day 4
ACM init()- Day 4
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
Educational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdfEducational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdf
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As Comp
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As Comp
 
Python Lecture 4
Python Lecture 4Python Lecture 4
Python Lecture 4
 
FUNCTIONINPYTHON.pptx
FUNCTIONINPYTHON.pptxFUNCTIONINPYTHON.pptx
FUNCTIONINPYTHON.pptx
 
C++ Homework Help
C++ Homework HelpC++ Homework Help
C++ Homework Help
 
Cpp Homework Help
Cpp Homework Help Cpp Homework Help
Cpp Homework Help
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdfProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
C++ Functions.ppt
C++ Functions.pptC++ Functions.ppt
C++ Functions.ppt
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
Programming Question.docx
Programming Question.docxProgramming Question.docx
Programming Question.docx
 

Mehr von Juliang56Parsonso

How do I get Main-java to compile- the program is incomplete - Need.docx
How do I get Main-java to compile- the program is  incomplete -  Need.docxHow do I get Main-java to compile- the program is  incomplete -  Need.docx
How do I get Main-java to compile- the program is incomplete - Need.docx
Juliang56Parsonso
 

Mehr von Juliang56Parsonso (20)

How is the process of recoding defined- (a) technique where the value.docx
How is the process of recoding defined- (a) technique where the value.docxHow is the process of recoding defined- (a) technique where the value.docx
How is the process of recoding defined- (a) technique where the value.docx
 
How is cognitive therapy different from rational-emotive therapy- Mult.docx
How is cognitive therapy different from rational-emotive therapy- Mult.docxHow is cognitive therapy different from rational-emotive therapy- Mult.docx
How is cognitive therapy different from rational-emotive therapy- Mult.docx
 
how has Information Systems impacted organizations- Research ways an o.docx
how has Information Systems impacted organizations- Research ways an o.docxhow has Information Systems impacted organizations- Research ways an o.docx
how has Information Systems impacted organizations- Research ways an o.docx
 
How is acid rain produced- CO2 molecules react with H2O molecules in t.docx
How is acid rain produced- CO2 molecules react with H2O molecules in t.docxHow is acid rain produced- CO2 molecules react with H2O molecules in t.docx
How is acid rain produced- CO2 molecules react with H2O molecules in t.docx
 
How Effective Managers Use Information Systems Advances in computer-ba.docx
How Effective Managers Use Information Systems Advances in computer-ba.docxHow Effective Managers Use Information Systems Advances in computer-ba.docx
How Effective Managers Use Information Systems Advances in computer-ba.docx
 
How do you think firms decide which type of private debts to use- Do t.docx
How do you think firms decide which type of private debts to use- Do t.docxHow do you think firms decide which type of private debts to use- Do t.docx
How do you think firms decide which type of private debts to use- Do t.docx
 
How does excess CO2 emission cause the reduction of coral reefs around.docx
How does excess CO2 emission cause the reduction of coral reefs around.docxHow does excess CO2 emission cause the reduction of coral reefs around.docx
How does excess CO2 emission cause the reduction of coral reefs around.docx
 
How do the concepts of -Cultural Relativism- and -Ethnocentrism- relat.docx
How do the concepts of -Cultural Relativism- and -Ethnocentrism- relat.docxHow do the concepts of -Cultural Relativism- and -Ethnocentrism- relat.docx
How do the concepts of -Cultural Relativism- and -Ethnocentrism- relat.docx
 
How do you change a column to an existing table in MS SQL Server- d- M.docx
How do you change a column to an existing table in MS SQL Server- d- M.docxHow do you change a column to an existing table in MS SQL Server- d- M.docx
How do you change a column to an existing table in MS SQL Server- d- M.docx
 
How do positively charged ions reach the upper portion of a thundersto.docx
How do positively charged ions reach the upper portion of a thundersto.docxHow do positively charged ions reach the upper portion of a thundersto.docx
How do positively charged ions reach the upper portion of a thundersto.docx
 
How do Palmer and hooks define vocation and purpose- Did they encounte.docx
How do Palmer and hooks define vocation and purpose- Did they encounte.docxHow do Palmer and hooks define vocation and purpose- Did they encounte.docx
How do Palmer and hooks define vocation and purpose- Did they encounte.docx
 
How do mobility barriers affect the strategy of a firm- They create is.docx
How do mobility barriers affect the strategy of a firm- They create is.docxHow do mobility barriers affect the strategy of a firm- They create is.docx
How do mobility barriers affect the strategy of a firm- They create is.docx
 
How do positively charged ions reach the upper portion of a thundersto (1).docx
How do positively charged ions reach the upper portion of a thundersto (1).docxHow do positively charged ions reach the upper portion of a thundersto (1).docx
How do positively charged ions reach the upper portion of a thundersto (1).docx
 
How do I get Main-java to compile- the program is incomplete - Need.docx
How do I get Main-java to compile- the program is  incomplete -  Need.docxHow do I get Main-java to compile- the program is  incomplete -  Need.docx
How do I get Main-java to compile- the program is incomplete - Need.docx
 
How can you integrate Machine learning and AI to improve security- Wha.docx
How can you integrate Machine learning and AI to improve security- Wha.docxHow can you integrate Machine learning and AI to improve security- Wha.docx
How can you integrate Machine learning and AI to improve security- Wha.docx
 
How do axial filaments differ from regular bacterial flagella- a- The.docx
How do axial filaments differ from regular bacterial flagella- a-  The.docxHow do axial filaments differ from regular bacterial flagella- a-  The.docx
How do axial filaments differ from regular bacterial flagella- a- The.docx
 
How can the money supply expand or shrink- How does the money supply r.docx
How can the money supply expand or shrink- How does the money supply r.docxHow can the money supply expand or shrink- How does the money supply r.docx
How can the money supply expand or shrink- How does the money supply r.docx
 
How big of a cash dividend needs to be declared to give the common sto.docx
How big of a cash dividend needs to be declared to give the common sto.docxHow big of a cash dividend needs to be declared to give the common sto.docx
How big of a cash dividend needs to be declared to give the common sto.docx
 
How are Mass and Matter related- None of these is the correct answer-.docx
How are Mass and Matter related- None of these is the correct answer-.docxHow are Mass and Matter related- None of these is the correct answer-.docx
How are Mass and Matter related- None of these is the correct answer-.docx
 
Hoperer Recwvabien Sehedile The fotowing accepints were uninterbenaly.docx
Hoperer Recwvabien Sehedile The fotowing accepints were uninterbenaly.docxHoperer Recwvabien Sehedile The fotowing accepints were uninterbenaly.docx
Hoperer Recwvabien Sehedile The fotowing accepints were uninterbenaly.docx
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Here is an example compilation and execution of the program- linux3-1-.docx

  • 1. Here is an example compilation and execution of the program: linux3[1]% g + + Wall lab2.cpp - o lab2 linux3[1]%. / obab How many ints would you like to multiply? 4 Please enter an int ( 1 of 4 ) : 3 Please enter an int ( 2 of 4 ) : 4 Please enter an int ( 3 of 4 ) : 1 Please enter an int (4 of 4 ) : 5 The product of your input ints is: 60 60 is greater than thirty! 10. Programming Assignment You will practice working with input/output, conditional logic, loops, and functions by adding code to the 1 ab 2 . cpp template provided. More specifically, you will need to add the function prototype and body for 2 functions, invoking them in main () as detailed below: - Implement the function productofints (). - The function should not have any parameters - The user should be asked to enter the number of ints they want to multiply together. - The user will then enter values until the number of specified ints is reached. - The function should then print and return the result of the product of the inputted numbers. - Implement the function lessThanThirty (). - The function should accept an int as a parameter. - If the passed in argument is less than thirty, the function should display a message that says it is less or greater than thirty - The function should not return anything. - Add a function call to productofints () and IessThanThirty () in main (). - The user should enter their desired amount of numbers, and the program should display the final value after the operations, as well as if the total is less than thirty or not. - This logic must be implemented in one line. This means that the main () function can have ONE statement (and the return 0 ).