In C++.
Two int variables, euroSales andasiaSales, have already been declared and initialized. Another intvariable, eurasiaSales, has already been declared.
Write a statement that calls add tocompute the sum of euroSales and asiaSales and store this value ineurasiaSales.
2. Write the definition of a function isSenior,that receives an integer parameter and returns true if theparameter's value is greater or equal to 65, and falseotherwise.
So, if the parameter's value is 7 or64 or 12 the function returns false. But if the parameter's valueis 69 or 83 or 65 the function returns true.
3. Write the definition of a function namedcounter that receives no parameters and returns 0 the first time itis invoked, returns 1 the next time it is invoked, then 2, 3 and soon.
4. Write the definition of a function namedtimeOnHighway that receives three parameters, all of type double:mileEndingPoint, mileStartingPoint, and speed. The first twoparameters indicate the mile markers on an interstate at which avehicle goes to and starts at; the third parameter indicates thespeed of the vehicle in miles per hour. The function returns thenumber of hours it takes a vehicle to go from the starting milemarker to the ending one. The function has a default value for thespeed: 55 miles per hour, and a default value formileStartingPoint: 0.0.
5. Write a function addOne that adds 1 to itsinteger reference parameter. The function returns nothing
6. Write the definitions for three functionsnamed max. Each receives two parameters, of the same type, andreturns the larger of the two values. Define one of these functionsto apply to type double, another to type int and a third to typechar.
7. Write the definition of a functionnamed panic. The function prints the message "unrecoverable error"and then terminates execution of the program, indicatingfailure.
In C++. Two int variables, euroSales and asiaSales, have already been declared and initialized. Another int variable, eu
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am