Question: USING C++ Exercise 2.16: Assuming calc is a function that returns a double, which, if any, o the following are illegal definitions? Correct any that
Exercise 2.16: Assuming calc is a function that returns a double, which, if any, o the following are illegal definitions? Correct any that are identified as illegal. (a) int car 1024, auto = 2048; (b) int ival = val; (c) std: :cin >> int input_value; (d) double salary = wage = 9999.99; (e) double calc calc) Exercise 2.23: Which of the following are legal? For those usages that are illegal, ex- plain why (a) const int buf; (b) int cnt = 0; const int sz cnt ; (c) cnt++i S2++ Exercise 2.30: Define the data members of classes to represent the following types: (a) a phone number (c) an employee or a company (b) an address (d) a student at a university Exercise 2.31: Identify which of the following statements are declarations and wh ones are definitions. Explain why they are declarations or definitions. (a) extern int ix = 1024; (b) int iy; (c) extern int iz; (d) extern const int &ri Exercise 2.32: Which of the following declarations and definitions would you a header? In a source file? Explain why put in (a) int var; (b) const double pi = 3.1416; (c) extern int total = 255; (d) const double sq2 sqrt (2.0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
