Let us assume the program below runs smoothly, identify all function arguments in each function call in exact order and separate each argument in just a comma:
int getCube(int number){ return number * number * number;}
char getLetter(double n) {if(n>50) {return'0';} return 'X'}
double getThis(int num){return 1.0;}
int main(){
int n1 = 10, n2 = 123;
double vall = 123.45, val2 = 456.234;
cout << getCube(10) << " " << getCube(123) << "\n";
cout << getLetter(val2) << "-" << getLetter(val1);
cout << getLetter(34.23) << "--" << getThis(88);
cout << getThis(val1);
return 0;
}
What is the Answer? :
Let us assume the program below runs smoothly, identify all function arguments in each function call in exact order and separate each argument in just a comma:
int getCube(int number){ return number * number * number;}
char getLetter(double n) {if(n>50) {return'0';} return 'X'}
double getThis(int num){return 1.0;}
int main(){
int n1 = 78, n2 = 55;
double vall = 123.56, val2 = 784.59;
cout << getLetter(val1) << "-" << getLetter(val1);
cout << getLetter(val2) << "--" << getThis(val2);
cout << getCube(123) " " << getCube(321) << "\n";
cout << getThis(val1);
return 0;
}
What is Answer:
1. Write C++ statements that prompt the user to enter a person’s last name and then store the last name into the variable name.
1. Create a new project with following particulars
1. name the project title in the following format “ID_section_lab#” e.g., “f2019065111_w1_lab2”.
2. Create a menu to execute tasks. There shall be n tasks in total, update as they comes up. You should properly prompt wherever necessary. A sample menu is shown below.
1. Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per gallon the automobile can be driven. The program outputs the number of miles the automobile can be driven without refueling.
1. Create a class polynomial to create a linked list that uses class node from task 1 with the following functionalities
a. Insertion. This function takes as an input the size of polynomial. E.g if the size is 6, the polynomial equation is of degree 6. Then you are required to create the appropriate list.
6x6+ 12x3+5
b. Deletion. This function deletes the list of the degree of number passed as a parameter. E.g if the number is 7, it is invalid. If it is 2, it deletes the first 2 degrees and the remaining list is 12x3+5
c. Overload the function of deletion. This function deletes the entire list.
d. Traversal
e. Print equation in the following format
6x6+0x5+0x4+ 12x3+0x2+0x1+5
1. Create a class Node with
a. attributes data and next pointer
b. accessors and mutators
c. constructor and destructor
d. function called display
e. search node returning true or false
f. overload the function search to include lookAhead method.
You are required to write a C++ program to assist Dr Plaatje with the running of her surgery. She
needs to know:
1) how many patients she has seen in the month.
2) the five (5) day in which she made most the money, (five highest earning days). If there are
more than one (1) days in which she made the same amount, just indicate that it was
duplicated on a particular day. Only note or record the last duplicate.
3) how much money she has collected in the month.
Also:
(a) Your program must run until the user stops it when the surgery closes at the end of the day,
when the report has to be generated.
(b) Assume a month has 31 days at most.
(c) Your program must ensure that input day is within the range [1..31]. It must not accept days
outside the range.
You are required to write a C++ program to assist Dr Plaatje with the running of her surgery. She needs to know: 1) how many patients she has seen in the month. 2) the five (5) day in which she made most the money, (five highest earning days). If there are more than one (1) days in which she made the same amount, just indicate that it was duplicated on a particular day. Only note or record the last duplicate. 3) how much money she has collected in the month. Also: (a) Your program must run until the user stops it when the surgery closes at the end of the day, when the report has to be generated. (b) Assume a month has 31 days at most. (c) Your program must ensure that input day is within the range [1..31]. It must not accept days outside the range.
#include<iostream>
#include<iomanip>
using namespace std;
char secretCode(int);
void printSequence(int);
int main(){
int number[10];
for (int index=0; index <10; index++){
cin >> number[index];
}
for (int index=0; index <10; index++){
cout <<secretCode( number[index]);
}
return 0;
}
char secretCode(int n){
char letters[] = "abcdefghijklmnopqrstuvwxyz";
int number=n;
while(number > 26){
number = number -26;
}
return letters[number-1];
}
Code above runs perfectly well,