SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
Given 4 integers, output their product and their average using integer arithmetic. Ex: If the input
is: 8 1054 the output is: 16006 Note: Integer division discards the fraction. Hence the average of
81054 is output as 6, not 6.75 . Note: The test cases include four very large input values whose
product results in overflow. You do not need to do anything special, but just observe that the
output does not represent the correct product (in fact, four positive numbers yield a negative
output; wow). Submit the above for grading. Your program will fail the last test cases (which is
expected), until you complete part 2 below. Part 2 Also output the product and average using
floating-point arithmetic. Output each floating-point value with three digits after the decimal
point, which can be achieved by executing cout fixed setprecision(3); once before all other cout
statements. Hint: Convert the input values from int to double. Ex: If the input is: 81054 the
output is: 16006 1600.000 6.750 2.51.1: LAB: Simple statistics 0/10 main.cpp Load default
template... Run your program as often as you'd like, before submitting for grading. Below, type
any needed input values in the first box, then click Run program and observe the program's
output in the second box.

Mais conteúdo relacionado

Semelhante a Given 4 integers- output their product and their average using integer.pdf

Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docx
dunhamadell
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docxCMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
clarebernice
 
CPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docxCPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docx
faithxdunce63732
 

Semelhante a Given 4 integers- output their product and their average using integer.pdf (20)

Stacks
StacksStacks
Stacks
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docx
 
Manual de la calculadora fxcalc
Manual de la calculadora fxcalcManual de la calculadora fxcalc
Manual de la calculadora fxcalc
 
Seminar 2 coding_principles
Seminar 2 coding_principlesSeminar 2 coding_principles
Seminar 2 coding_principles
 
Input-output
Input-outputInput-output
Input-output
 
A01
A01A01
A01
 
C++ Homework Help
C++ Homework HelpC++ Homework Help
C++ Homework Help
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
Lab5
Lab5Lab5
Lab5
 
Useful macros and functions for excel
Useful macros and functions for excelUseful macros and functions for excel
Useful macros and functions for excel
 
Advanced Computer Programming..pptx
Advanced Computer Programming..pptxAdvanced Computer Programming..pptx
Advanced Computer Programming..pptx
 
Comp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codeComp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source code
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docxCMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
 
CPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docxCPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docx
 
03b loops
03b   loops03b   loops
03b loops
 
Ecad final
Ecad finalEcad final
Ecad final
 
C important questions
C important questionsC important questions
C important questions
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 

Mais de aoneelectronices

Mais de aoneelectronices (20)

Given the following Summary Table from a Transportation Method Product.pdf
Given the following Summary Table from a Transportation Method Product.pdfGiven the following Summary Table from a Transportation Method Product.pdf
Given the following Summary Table from a Transportation Method Product.pdf
 
Given the following probability distributions or risky assets X and Y.pdf
Given the following probability distributions or risky assets X and Y.pdfGiven the following probability distributions or risky assets X and Y.pdf
Given the following probability distributions or risky assets X and Y.pdf
 
Given the following Internet protocol stack diagram- match the numbere.pdf
Given the following Internet protocol stack diagram- match the numbere.pdfGiven the following Internet protocol stack diagram- match the numbere.pdf
Given the following Internet protocol stack diagram- match the numbere.pdf
 
Given the code below- what is printed to the screen when the user give.pdf
Given the code below- what is printed to the screen when the user give.pdfGiven the code below- what is printed to the screen when the user give.pdf
Given the code below- what is printed to the screen when the user give.pdf
 
Given the financial data below- 1) Set up the worksheet for the Statem.pdf
Given the financial data below- 1) Set up the worksheet for the Statem.pdfGiven the financial data below- 1) Set up the worksheet for the Statem.pdf
Given the financial data below- 1) Set up the worksheet for the Statem.pdf
 
Given the economic information regarding inflation- When inflation sub (1).pdf
Given the economic information regarding inflation- When inflation sub (1).pdfGiven the economic information regarding inflation- When inflation sub (1).pdf
Given the economic information regarding inflation- When inflation sub (1).pdf
 
Given the DFAs M1 and M2 below- write a formal definition of M1M2 -eit.pdf
Given the DFAs M1 and M2 below- write a formal definition of M1M2 -eit.pdfGiven the DFAs M1 and M2 below- write a formal definition of M1M2 -eit.pdf
Given the DFAs M1 and M2 below- write a formal definition of M1M2 -eit.pdf
 
Given the defaut property value for a Sorver (Input Bufter Cepacty set.pdf
Given the defaut property value for a Sorver (Input Bufter Cepacty set.pdfGiven the defaut property value for a Sorver (Input Bufter Cepacty set.pdf
Given the defaut property value for a Sorver (Input Bufter Cepacty set.pdf
 
Given the corporate and product level reporting timelines- which EU ta.pdf
Given the corporate and product level reporting timelines- which EU ta.pdfGiven the corporate and product level reporting timelines- which EU ta.pdf
Given the corporate and product level reporting timelines- which EU ta.pdf
 
Given that the cdf of a discrete random variable Y is F(y)-0-41-21-43-.pdf
Given that the cdf of a discrete random variable Y is F(y)-0-41-21-43-.pdfGiven that the cdf of a discrete random variable Y is F(y)-0-41-21-43-.pdf
Given that the cdf of a discrete random variable Y is F(y)-0-41-21-43-.pdf
 
Given that x has a Poisson distribution with -6- what is the probobili.pdf
Given that x has a Poisson distribution with -6- what is the probobili.pdfGiven that x has a Poisson distribution with -6- what is the probobili.pdf
Given that x has a Poisson distribution with -6- what is the probobili.pdf
 
Given that it takes 40 minutes for E- coli to replicate its genome- is.pdf
Given that it takes 40 minutes for E- coli to replicate its genome- is.pdfGiven that it takes 40 minutes for E- coli to replicate its genome- is.pdf
Given that it takes 40 minutes for E- coli to replicate its genome- is.pdf
 
Given Information- Period 1 is when Devah is working and earning money.pdf
Given Information- Period 1 is when Devah is working and earning money.pdfGiven Information- Period 1 is when Devah is working and earning money.pdf
Given Information- Period 1 is when Devah is working and earning money.pdf
 
Given a data set containing 54 observations- please use the Minitab ap.pdf
Given a data set containing 54 observations- please use the Minitab ap.pdfGiven a data set containing 54 observations- please use the Minitab ap.pdf
Given a data set containing 54 observations- please use the Minitab ap.pdf
 
Given an list of Strings- return the length of the longest String in t.pdf
Given an list of Strings- return the length of the longest String in t.pdfGiven an list of Strings- return the length of the longest String in t.pdf
Given an list of Strings- return the length of the longest String in t.pdf
 
Given a list of ints- return true if the number 1 appears exactly once.pdf
Given a list of ints- return true if the number 1 appears exactly once.pdfGiven a list of ints- return true if the number 1 appears exactly once.pdf
Given a list of ints- return true if the number 1 appears exactly once.pdf
 
Give the description-location and function of each of the following ly.pdf
Give the description-location and function of each of the following ly.pdfGive the description-location and function of each of the following ly.pdf
Give the description-location and function of each of the following ly.pdf
 
Given a recurrence T(n)-T(n-5)+T(n-3)+cn2- show that T(n) is in the O(.pdf
Given a recurrence T(n)-T(n-5)+T(n-3)+cn2- show that T(n) is in the O(.pdfGiven a recurrence T(n)-T(n-5)+T(n-3)+cn2- show that T(n) is in the O(.pdf
Given a recurrence T(n)-T(n-5)+T(n-3)+cn2- show that T(n) is in the O(.pdf
 
Genetic Drift can occur through which of the following- Environmental.pdf
Genetic Drift can occur through which of the following- Environmental.pdfGenetic Drift can occur through which of the following- Environmental.pdf
Genetic Drift can occur through which of the following- Environmental.pdf
 
Give me a brief discussion on the economy and FED action taken since a.pdf
Give me a brief discussion on the economy and FED action taken since a.pdfGive me a brief discussion on the economy and FED action taken since a.pdf
Give me a brief discussion on the economy and FED action taken since a.pdf
 

Último

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Último (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

Given 4 integers- output their product and their average using integer.pdf

  • 1. Given 4 integers, output their product and their average using integer arithmetic. Ex: If the input is: 8 1054 the output is: 16006 Note: Integer division discards the fraction. Hence the average of 81054 is output as 6, not 6.75 . Note: The test cases include four very large input values whose product results in overflow. You do not need to do anything special, but just observe that the output does not represent the correct product (in fact, four positive numbers yield a negative output; wow). Submit the above for grading. Your program will fail the last test cases (which is expected), until you complete part 2 below. Part 2 Also output the product and average using floating-point arithmetic. Output each floating-point value with three digits after the decimal point, which can be achieved by executing cout fixed setprecision(3); once before all other cout statements. Hint: Convert the input values from int to double. Ex: If the input is: 81054 the output is: 16006 1600.000 6.750 2.51.1: LAB: Simple statistics 0/10 main.cpp Load default template... Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box.