1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
NISA [10]
3 years ago
7

The "odd/even factorial" of a positive integer n is represented as n and is defined non-recursively as: (n)(n-2)(n-4)...(4)(2) i

f n is even and is (n)(n-2)(n-4)...(5)(3) (1) if n is odd. For example 7 equals 7*5*3*1 or 105 and 6 equals 6*4*2 or 48. Come up with a recursive definition for n and use it to guide you to write a method definition for a method called oddevenfact that recursively calculates the odd/even factorial value of its single int parameter. The value returned by oddevenfact is a long..
Computers and Technology
1 answer:
adoni [48]3 years ago
3 0

Answer:

The function definition to this question can be described as follows:

long oddevenfact(int y) //defining a method oddevenfact

{

//defining conditional statement    

if (y>2) //check value is greater then 2

{

return( oddevenfact(y-2) * (long) y); //return value

}

else //else

{

return((long) y); //return its value

}

}

Explanation:

The description of the above method definition can be described as follows:

  • In the above method definition a long method "oddevenfact" is declared, which accepts an integer variable "y" as its arguments, and return value as long.
  • Inside the method, a conditional statement is used, in if the block, it checks a value, that is value is greater then 2, and inside the block, a recursive function is used, that calculates its factor, and returns its value in long type.  
  • If the condition is not true, it will go to else block and return in long type value.
You might be interested in
Software that manages the resources of the computer is called:
AleksAgata [21]
A. Data management software.
6 0
3 years ago
You are embedding a video in your Webpage. What three formats should you specify in the source
Bogdan [553]

Answer:

d

Explanation:

3 0
3 years ago
The spreadsheet ends after you reach column Z and row 99. True or false
Mandarinka [93]

Answer:

False

Explanation:

Excel Spreadsheet 2010 and above have 2^14 columns i.e. 16384 columns and 2^20 rows i.e. 1048576 rows.

First 26 columns are from A to Z and then the next column will user another Digit and start with A, so the 27th column will be AA.

26th column = Z

27th column = AA

28th column = AB

etc.

8 0
3 years ago
Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:
Juliette [100K]

Answer:

#include <iostream>

using namespace std;

class DogLicense{

   public:

       void SetYear(int yearRegistered);

       void CreateLicenseNum(int customID);

       int GetLicenseNum() const;

   private:

       int licenseYear;

       int licenseNum;

};

void DogLicense::SetYear(int yearRegistered) {

   licenseYear = yearRegistered;

}

void DogLicense::CreateLicenseNum(int customID) {

   licenseNum = (100000 * customID) + licenseYear;

}

int DogLicense::GetLicenseNum() const {

   return licenseNum;

}

int main() {

   DogLicense dog1;

   dog1.SetYear(2014);

   dog1.CreateLicenseNum(777);

   cout << "Dog license: " << dog1.GetLicenseNum() << endl;

return 0;

}

Explanation:

You can see the whole code above, but let me explain the fixed function.

void DogLicense::CreateLicenseNum(int customID) {

   licenseNum = (100000 * customID) + licenseYear;

}

The function header is already declared in the class. It takes <em>customID</em> as a parameter. To find out the <em>lisenseNum</em>, we need to apply the given formula <em><u>(100000 * customID) + licenseYear</u></em>.

6 0
4 years ago
Read 2 more answers
The instant pivot button is displayed in the statistics and visualization tabs when a _______ search is run.
Arisa [49]

Answer:

<h2>The instant pivot button is displayed in the statistics and visualization tabs when a <u>non-transforming</u>  search is run. </h2>

Explanation:

<h3>Transforming Search:</h3>

It can be defined as a search in which transforming commands are used that involve, charts and stats to convert data of events that is gained by the search in to tables (statistical). These tables can further be used for the basis of visualizing data in the form of charts.

Non-Transforming Search:

The search that do no contains produce event lists that can be viewed in Events tab. while using non-transforming search, i we want to generate tables or charts we must follow the points below:

  • Click ob statistics and Visualization tab.
  • Select pivot to open the search.
  • All the visualizations can be generated in this editor.

<h2>i hope it will help you!</h2>
5 0
4 years ago
Other questions:
  • David has a laptop that is having a problem with the video system. You believe the problem might be the backlight. During your r
    13·1 answer
  • 19. Squares. Write a program class named SquareDisplay that asks the user for a positive integer no greater than 15. The program
    11·1 answer
  • How do I attach a file on the computer?
    13·1 answer
  • Suppose we are given an arbitrary digraph G = (V, E) that may or may not be a DAG. Modify the topological ordering algorithm so
    8·1 answer
  • What are 7 key traits for knowing your audience
    6·2 answers
  • Have you ever tried to learn a new language or do you have friends who've had that experience? What are some of the steps you wo
    10·2 answers
  • Most sources consider the ARPA-NET project the birth of computer blank<br> .
    11·2 answers
  • The physical parts of a computer are called application software.
    9·2 answers
  • In MS Word we can merga cells true or false​
    13·2 answers
  • Provide 10 points for each question
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!