quiz حل الأسئلة الجامعية manage_search الأرشيف

تم الحل ✓
categoryبرمجة وتطوير البرمجيات schoolبكالوريوس event_available2026-07-14

السؤال

Transcribed Image Text:

Q3: (Carbon Footprint Calculator: Arrays of Function Pointers) (25 points) Using arrays of function pointers, you can specify a set of functions that are called with the same types of arguments and return the same type of data. Governments and companies worldwide are becoming increasingly concerned with carbon footprints (annual releases of carbon dioxide into the atmosphere) from buildings burning various types of fuels for heat, vehicles burning fuels for power, and the like. Many scientists blame these greenhouse gases for the phenomenon called global warming. Create three functions that help calculate the carbon footprint of a building, a car and a bicycle, respectively. Each function should input appropriate data from the user, then calculate and display the carbon footprint. Each function should receive no parameters and return void. Write a program that prompts the user to enter the type of carbon footprint to calculate, then calls the corresponding function in the array of function pointers. For each type of carbon footprint, display some identifying information and the object's carbon footprint. You can see more details about Carbon foot print: http://www.carbonindependent.org/ The following table shows the values you need in this program.. Category Building CO2 and other greenhouse gas emissions (tonnes CO2 equivalent) Based on a household size of: 1 CO2 and other greenhouse gas emissions (tonnes) 1.58 Sub category Small house/Flat • Medium 2.53 Large house 3.69 Vehicle • Small car 37 • Medium car 33 Large car 24 bike . Any type .3

check_circle الجواب — حل مفصل خطوة بخطوة

hourglass_top