Use the following information to answer questions 6.1–6.6. Line numbers within each function have been included for reference.
A
1 void printHeading()
2 {
3 cout << "The History of Computers \n";
4 }
The program s main function includes the following code segment.
12 for (int count = 0; count < 3; count++)
13 { printHeading ();
14 cout << "I called printHeading \n";
15 }
6.1 Does line 1 contain a function header or a function call?
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Programming in C
Starting Out with Python (3rd Edition)
Introduction To Programming Using Visual Basic (11th Edition)
- Exercise 9-6: Pass by Reference and Pass by Address In this exercise, you use what you have learned about passing arguments by reference and by address to functions to answer Questions 1-2. 1. Given the following variable and function declarations, write the function call and the function's header a. double price 22.95, increase .10; void changePrice(doubl e&, double); b. double price 22.95, increase .10; void changePrice (double*, double); c. int age = 23; void changeAge(int&); d. int age 23; void changeAge (int*); 2. Given the following function headers and variable declarations, write a function call: a. custNames [] = {"Perez", "Smith", "Patel", "Shaw"}; balances [] = {34.00, 21.00, 45.50, 67.00); void cust (string name [], double bal []) b. int values [] = {1, 77, 89, 321, -2, 34}: void printSum (int nums [])arrow_forwardPython 3.7.4 Given that add, a function that expects two int parameters and returns their sum, and given that two variables, euro_sales and asia_sales, have already been defined: Write a statement that calls add to compute the sum of euro_sales and asia_sales and that associates this value with a variable named eurasia_sales.arrow_forward6.use c code to Develop a code that gets two integers from the user and calculates and prints their least common multiplier or LCM. LCM is the smallest number that divides both given integers. Example. lcm (10, 15) = 30, lcm (5,7) = 35 and lcm (12, 24) = 24Hint: we know that lcm(x,y) = xy/gcd(x,y) where gcd is the greatest common divisor (discussed in class). Develop a gcd function in your code, get the two numbers from the user, call your function to calculate their gcd and then use the formula above to calculate and display their lcm GOOD LUCK! Reference This is a list of function prototypes of the C library functions presented in class. You may use any of these functions in your solutions (unless the requirements explicitly indicate otherwise). As you have been provided the function prototypes, you are expected to use the functions correctly in your solutions. double atof(char *string); int atoi(char *string); long atol(char *string); int fclose(FILE *filePointer); char *fgets(char…arrow_forward
- PLEASE USE JAVA Equivalence Class Software Testing Question: A function foo has k integers as input arguments, i.e., foo(int n1, int n2, …, int nk). Each argument may belong to a different equivalence class, which are stored in an Eq.txt file. In the file, the nth row describes the nth input. Take the second row for example. The data 1, 10; 11, 20; 21, 30 indicates that n2 has three equivalence classes separated by the semi-colons. There is an internal method “int check(int n)” that returns the equivalence class n is in. The result of check(n2 = 3) will be 1 and check(n2 = 25) will be 3. Regarding the function foo, it computes the sum of the returned values by the check function for all input arguments. Follow the Eq.txt file to automatically create test cases for Strong Normal Equivalence class testing. The input argument values are randomly generated. Store your prepared test cases to a test.txt file. Each test case comes with an expected output at the end. All values are delimited…arrow_forward1. Inspect the code and in your own interpretation, describe the reason call to functionChangeIt_1(n) will not change x in main()? 2. Inspect the code and in your own interpretation, describe the reason parameter n inChangeIt_2(int *n) is a pointer, and statement in the function is *n = 6 ? 3. Write a function called void swap with two parameters, which will receive the addressof x and y as pointer. The function should swap the value of x and y only if x is larger thany. Print the value of x and y after the function call. 4. Write a function called double getAverage(int *array, int SIZE), whereit accept the array as pointer, and return the average of the array. Print the returnedvalue from this function. Always use *array rather than subscript to access the arrayvalue.arrow_forwardQ. Please solve this C++ program and show all the steps. (kindly do not use any advanced coding or coding info from any other program. Don't copy from other sources too) a) Add a new function convMonth to the class Date that returns the month in letters (e.g., January, February, etc.). b)Add a function that prints the date using the following format: Month dd, yyyy . Example, January 21, 2023 c) Test the new functions of the class Date by creating dynamically (i.e., using pointers) two objects of the class Date and invoking the new member functions on both objects. Deliverables: date.h, date.cpp, testdate.cpp. (any description or thought process of this coding problem will be really useful, particularly in part c) please let me know if there's any way I could contact you for further assistance,( please!) Thank you !arrow_forward
- 36- Consider the following function call: min(x, y) What is the function name and what is the first argument? a. The function name is min and the first argument is x b. Functions in Python don't have names (they're anonymous functions), but the first argument is x. c. The function name is min, but you need to see the function definition to determine the arguments. d. Functions in Python don't have names (they're anonymous functions) and you need to see the function definition to determine the argumentsarrow_forwardPlease help me explain the following void function c++ code, which I did not understand. Especially for the first void function and int main(), I do not understand why the first void function enter the number and the int main function print out the final answer. #include <iostream>using namespace std; void getNumber(int *input); void doubleValue(int *val); int main(){ int number; getNumber(&number); doubleValue(&number); cout<<"That value doubled is"<<number<<endl; return 0;}void getNumber(int *input){ cout<<"Enter an integer number:"; cin>>*input; }void doubleValue(int *val){ *val *=2;}arrow_forward3.use c code to Write a function that gets two same size arrays as parameters and determines if they are permutations of each other. Two arrays are permutations of each other if one can be obtained by shuffling the other. If the arrays are permutations, the function should return 1 otherwise it should return 0. A suggested prototype for that function could be:int isPermutation(int array1[], int array2[], int commonSize) Example: If the two arrays are: Array1: {1,2,4,0, 5} Array2: {0,5,3,2, 1) Function should return a 0. If the ‘3’ in Array2 is changed to ‘’, it should return 1 Hint: answer must use c code and show the outputarrow_forward
- 12) Consider the following function: def squareArea(sideLength) : return sideLength ** 2 What is the value of squareArea(3)? _____ a.2 b.3 c.6 d.9arrow_forwardQ#2 Write a recursive function zeroCount ( int a[ ], int s, int e) that receives an array of integers a [], a start index s, and an end index e. The function should return the number of zeros in that array between s and e. int zeroCount ( int a[ ], int s, int e); Trace your function given the following array and function call. Draw your steps. int a[ ] = {1, 0, 0, 5}; int zeros = zeroCount(a, 0, 3); language c++arrow_forward5.11 LAB: User-Defined Functions: Max and min numbers Coral language only please Define a function named LargestNumber that takes three integers as parameters and returns the largest integer. Define a second function named SmallestNumber that takes three integers as parameters and returns the smallest integer. Then, write a main program that reads three integers as inputs, calls functions LargestNumber() and SmallestNumber() with the inputs as arguments, and outputs the largest and the smallest of the three input values. Ex: If the input is: 7 15 3 the output is: largest: 15 smallest: 3 Your program should define and call two functions:Function LargestNumber(integer num1, integer num2, integer num3) returns integer largestNumFunction SmallestNumber(integer num1, integer num2, integer num3) returns integer smallestNumarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning