answer.
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]
2 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]2 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
Your friends credit scores are 560, 675, 710, 590, and 640. Your credit score is 680. What is the difference between the average
Wittaler [7]

Answer:

560+675+710+590+640=3175/5=635

so your credit score is 45 credits better than the average of your friends

Explanation:

3 0
2 years ago
George is working with an image in Photoshop. He added a lot of effects to the image. He saved the first draft of the file. The
Alja [10]

Answer:

JPEG, PDF

Explanation:

3 0
2 years ago
Read 2 more answers
If you're found to be at fault in _____, your driver license will be canceled within 90 days unless you complete a 12-hour Advan
Viktor [21]

<u>Answer:</u>

<em>D. three crashes within three years.</em>

<u>Explanation:</u>

Rules differ from Country to Country. <em>In United States Of America, the traffic rules are so strict and the process of License</em> is followed strictly and people who are violating rules gets a penalty or punishment in such a way that it changes their <em>mindset to follow the traffic rules strictly.</em>

All these are done to <em>safe guard people, avoid injuries and sudden loss of death due to accidents.</em>

So if a driver has done three crashes within <em>36 months of time, then the driver license is likely to get cancelled within 90 days.</em>

<em>In order to avoid this it is necessary for the driver to appear for improvement course of driving and appear for the test once again.</em>

5 0
2 years ago
Read 2 more answers
Which command backs up the single database called 'websites' to the file 'websites_backup.sql'?
kaheart [24]

Answer:

(d) mysqldump websites -u root -p > websites_backup.sql

Explanation:

To create a backup mysqldump is used.It is a data backup program.This program was originally written by Igor Romanenko. It creates a backup of file name websites_backup.sql.

So among the given options in the question option d is the correct option which backs up the single database websites in the file website_backup.sql.

8 0
2 years ago
6. A small design agency you are consulting for will be creating client websites and wants to purchase a web server so they can
Novay_Z [31]

Answer:

Explanation:

The best way to advise the agency in this matter would be to help them completely understand the total cost of ownership of the server. This includes the server itself but many other factors as well. Such as any and all server software and application software that they will need, an IT server manager, facility costs, security costs, backup features. These are some of the main costs that they will be incurring but there may be more unforeseen costs. Therefore the best way to advise them is by providing all of this information so that they can make the most informed decision possible.

3 0
2 years ago
Other questions:
  • Consider a simple application level protocol built on top of udp that allows a client to retrieve a file from a remote server re
    15·2 answers
  • A router is involved in ____________ layers of the tcp/ip protocol suite.
    12·1 answer
  • If a street has a central lane bordered by solid yellow and broken yellow lines, you ________________.
    6·1 answer
  • Interactive sites where users write about personal topics and comment to a threaded discussion are called 
    15·1 answer
  • Assume that name has been declared suitably for storing names (like "Misha", "Emily" and "Sofia"). Assume also that stdin is a v
    9·1 answer
  • In step 4 of the CSMA/CA protocol, a station that successfully transmits a frame begins the CSMA/CA protocol for a second frame
    9·1 answer
  • Carmina wants to move a paragraph to the right margin of the document she is working in. She moves her cursor to
    8·2 answers
  • Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search.
    11·2 answers
  • Define a structure type auto_t to represent an automobile. Include components for the make and model (strings), the odometer rea
    13·1 answer
  • Consider the following class definitions.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!