Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SENG 3337 March 9, 2021 Homework #1 (Part 1) (Hardcopy submission on standard size white printer paper) (Function Overloading) Q1. Write declarations for two functions
SENG 3337 March 9, 2021 Homework #1 (Part 1) (Hardcopy submission on standard size white printer paper) (Function Overloading) Q1. Write declarations for two functions (same name - overloaded): one calculates (and returns) the average of three integers and the other calculates and returns) the average of three double numbers. Choose the appropriate type for the return value. Also, write their definitions. (File Input/Output) Q2. Write statements to define an input stream and an output stream and associate them to the following files, respectively: in dat, out.dat. Assume that in.dat has eight integers. Write statements to calculate the sum, product, and average of the integers and to write these values to out.dat. (Multidimensional Array) Q3. Declare a two dimensional array that records hourly temperature of seven days of week. For example, the element (0, 0) holds the temperature of Monday at 0 hours and the element (6, 23) holds the temperature of Sunday at 23 hours. Write statements (within a loop) to fill out this array with values equal to the hour. (Recursive Function for Value) Q4. Write a recursive function that has an integer input parameter (n) and retums: 1+12+1/3+1/4+...+1 (END)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started