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
geniusboy [140]
3 years ago
8

Give a recursive algorithm for finding the sum of the first n odd positive integers.

Computers and Technology
1 answer:
Andrei [34K]3 years ago
3 0
I'm writing that in some sort of pseudocode; if you don't understand it, feel free to ask for more details in the comments.

function sumOdd(n)
    if n==1 then
        return 1
    end if
    return (sumOdd(n-1))+(n*2-1)
end function
You might be interested in
Rewrite this if/else if code segment into a switch statement int num = 0; int a = 10, b = 20, c = 20, d = 30, x = 40; if (num &g
Tanya [424]

Answer:

public class SwitchCase {

   public static void main(String[] args) {

       int num = 0;

       int a = 10, b = 20, c = 20, d = 30, x = 40;

       switch (num){

           case 102: a += 1;

           case 103: a += 1;

           case 104: a += 1;

           case 105: a += 1;

           break;

           case 208: b += 1; x = 8;

           break;

           case 209: c = c * 3;

           case 210: c = c * 3;

           break;

           default: d += 1004;

       }

   }

}

Explanation:

  • Given above is the equivalent code using Switch case in Java
  • The switch case test multiple levels of conditions and can easily replace the uses of several if....elseif.....else statements.
  • When using a switch, each condition is treated as a separate case followed by a full colon and the the statement to execute if the case is true.
  • The default statement handles the final else when all the other coditions are false
3 0
2 years ago
How to Save Power-Point presentation as a single file Web page that can be uploaded to the World Wide Web ?
Fittoniya [83]
Google docs and save it there. hope this helps. thanks
3 0
2 years ago
In a relational database application, a(n) ________ key is used to link one table with another.
mr_godi [17]

In a relational database application, a <u>foreign key</u> is used to link one table with another.

<h3>What is a foreign key?</h3>

In database management system (DBMS), a foreign key can be defined as a column whose value provides a link between the data that are stored in a table or relational database.

This ultimately implies that, a <u>foreign key</u> is used to link one table with another in a relational database application.

Read more on keys here: brainly.com/question/8131854

#SPJ12

6 0
1 year ago
Why are new versions of applications packages released often ​
stellarik [79]

Answer:

The answer is "new version of application provides more easy to use".

Explanation:

  • In computer science, an application is a program, that is installed on the computer. There are many types of application software, that are "gaming software, working software, programming software, etc." At the end of time users want some new things in software to know users need programmer developed new versions of the software.
  • The update usually improves the device or service in its current version, whilst an improvement is an entirely new version. Installation is usually free and easy. You also have to wait for updates that are difficult to install.
5 0
2 years ago
Mation about which osi layers of connected cisco devices can be verified with the show cdp neighbors comm
fgiga [73]
The show CDP neighbor command operates at the Data link layer (Layer 2)

Cisco Discovery Protocol (CDP) is a proprietary Data Link Layer protocol developed by Cisco Systems. It is used to share information about other directly connected Cisco equipment, such as the operating system version and IP address.

6 0
3 years ago
Other questions:
  • If a gas gosts 3.60 per gallon how much doe sit cost to drive 500 miles in the city
    5·1 answer
  • Which part of the cpu stores instructions for high speed access or processing
    14·1 answer
  • Write a program that reads a list of scores and then assigns grades python
    9·1 answer
  • Which of these BEST describes an inference?
    11·2 answers
  • Jerry’s managing a Google Search campaign and would like to improve the position in which his ads appear. He’s increased his bid
    15·1 answer
  • How many of you got the right answer from this app​
    8·1 answer
  • Fill in the blanks:
    15·1 answer
  • What happens when the electrons flowing through the light bulb change direction?
    11·1 answer
  • [C++] 4.17 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in
    8·1 answer
  • To stored three characters a computer occupies. Bytes memory space
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!