1.Write a function definition, convertInCm, which converts its real argument, inches, to centimeters. 1 inch = 2.54 centimeters
2.Write the function prototype for convertInCm
3.Write the function call for convertInCm. Store the results in the variable centimeters. Assume centimeters had been previously declared a double.
4.Write one C++ statement declare global named constants needed to establish the dimensions of a 2D array of integers with five rows and three columns.
5.Write one C++ statement to declare the 2D array int_array.
6.Write one C++ statement that would assign the value 61 to the third row, second column of int_array.
7.Write only the snippet of C++ code for a function definition, printColumn, which prints to the console the values in a column specified by the user in the function call. printColumn has two arguments, the 2D array and a integer column number, listed in this order. Protect arguments from being changed by the function when necessary.
8.Write a complete C++ program that uses a structure to store customer data.
For full credit, you must process as follows:
Globally declare a named constant, length, to represent the maximum allowed length of a customers name.
Globally declare a structure, CustomerData, with the following members, defined in this order:
a character array to hold the customers name (at most 65 character in length)
the customers integer account number
the customers account balance
Locally define a structure variable of type CustomerData named customer1 initialized to the following values in this order: your instructors name (last name, first name); 00000; 79.95
Call a void function , getAcctNumber, which will prompt the user for the customers correct account number, storing it in the appropriate structure member. The call to getAcctNumber looks like this: getAcctNumber ( customer1);
Call a void function, printCustomerAcct, which will print one blank line to the console followed by the single-spaced member values, one member per line. The call to printCustomerAcct looks like this: printCustomerAcct ( customer1 );
Notes: Pass the structure in the most efficient way while still protecting the data if necessary. Display the customers account balance to two decimal places.
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.