Questions: 9 913

Answers by our Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

I'm really fond of even numbers, you know? That's why I'll be letting you make another even

number problem yet again. This time, you need to print from a range of two inputted numbers,

n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order


  1. In the code editor, you are provided with a main() function that asks the user for an integer and passes the address of this integer to a function call of the simple() function.
  2. This simple() function hasn't been implemented yet so your task is just that, to implement it. This has the following description:
  3. Return type - void
  4. Name - simple
  5. Parameter - address of an integer
  6. Description - prints a line of asterisks
  7. DO NOT EDIT THE MAIN FUNCTION

Input


1. An integer

Output


Enter·n:·5
*****

#include <iostream>

using namespace std;


int main(void) {

  int n;


  cout << "Enter n: ";

  cin >> n;


  simple(&n);

  

 cout << n;


  return 0;

}


  1. In the code editor, you are provided with a main() function that asks the user for 2 integers. Then, a function call to a function named, exchangeGift() is made and the addresses of the 2 integers are passed.
  2. This exchangeGift() function hasn't been implemented yet so this is your task. This has the following description:
  3. Return type - void
  4. Name - exchangeGift
  5. Parameters - 2 addresses of 2 integers
  6. Description - swaps the value of the 2 integers and then adds 100 to the 2nd integer (or 2nd parameter)
  7. DO NOT EDIT THE MAIN

Input


1. First integer

2. Second integer

Output


Enter·integer·1:·10
Enter·integer·2:·20
20·110

#include <iostream>

using namespace std;


int main(void) {

  int a, b;


  cout << "Enter integer 1: ";

  cin >> a;


  cout << "Enter integer 2: ";

  cin >> b;


  exchangeGift(&a, &b);


  cout << a << " " << b;


  return 0;

}


Instructions:

  1. In the code editor, you are provided with an initial code where a constant variable is declared.
  2. Your only task is to assign the address of this variable to the first pointer found at line 10.

Output


My·destiny·=·11



#include <iostream>

using namespace std;


int main(void) {

  int destiny = 22;


  int *ptr1, *ptr2, *ptr3;


  // TODOFill in the blank

  ptr1 = ;

  ptr2 = ptr1;

  ptr3 = ptr2;


  cout << "My destiny = " << *ptr3;


  return 0;

}





Compute the total quiz and average quiz of three (3) scores. Determine if the average score is greater than or equal to 70, if TRUE , display Remarks is “ PASSED” otherwise display “FAILED”.


Write a program that will be able to classify fruits based on their (1) shape, (2) color and (3) texture. We have the following assumptions:


shape can assume any of the two values, namely: 0 to represent a round shape, 1 to represent an oblong shape


color can assume any of the three values, namely: 0 to represent a green color, 1 to represent a yellow color, 2 to represent a red color, and 3 to represent an orange color


texture can assume any of the two values, namely: 0 to represent smooth texture and 1 to represent a rough texture


2. The program should be able to determine the following fruits with the following characteristics:



apple: round shape, red color, smooth texture


banana: oblong shape, yellow color or green color, smooth texture


orange: round shape, orange color, smooth texture


jackfruit: oblong shape, green color, rough texture


Q ⊂ R+

a. true

b. false



Create a class Zero, write a function called zero_small) that has two integer arguments being passed by reference and sets the smaller of the two numbers to 0.


Runtime input:


23


6


Output:


23



Create a class Zero, write a function called zero_small) that has two integer arguments being passed by reference and sets the smaller of the two numbers to 0.


Runtime input:


23


6


Output:


23



Create a class Zero, write a function called zero_small) that has two integer arguments being passed by reference and sets the smaller of the two numbers to 0.

Runtime input:

23

6

Output:

23



LATEST TUTORIALS
APPROVED BY CLIENTS