Function to the sum the series up to n terms

Assignment Help Basic Computer Science
Reference no: EM131963240

Ask the user to enter a number n. function to the sum the following series up to n terms

0 + 4 + 16 + 36 .... (squares of even numbers)

Note: Your code must use a function which takes n as input and produces the sum as output. Just outputting the result will get you half points.

Sample Output 1:

Please enter n: 2

4

Sample Output 2:

Please enter n: 3

20

Q1b. 20 points mixing lists:

Ask the user to input two lists of equal size. new list which interleaves the two lists by taking 3 numbers from the first list and then 3 numbers from the second list. Output the interleaved list. If the lists' lengths are not a multiple of 3 just append the remaining numbers from list one followed by the remaining numbers from list 2 at the end.

Sample Output 1:

Please enter list 1: 1 2 3 4 5 6

Please enter list 2: 7 8 9 10 11 12

The combined list is 1 2 3 7 8 9 4 5 6 10 11 12

Sample Output 2:

Please enter list 1: 1 2 3 7

Please enter list 2: 4 5 6 8

The combined list is 1 2 3 4 5 6 7 8

Sample Output 2:

Please enter list 1: 1 2 4 0 0

Please enter list 2: 13 3 5 7 7

The combined list is 1 2 4 13 3 5 0 0 7 7

Reference no: EM131963240

Questions Cloud

Write a clear framing of the issue and thesis statement : Write a clear framing of the issue and thesis statement in an intro and three supporting reasons which are themselves explained and supported in body paragraph.
Print the results of the red black tree : Write the C++ program that implement and print the results of the Red Black tree after inserting the following nodes {122, 110, 130, 113,160}?
Which model has the greatest potential to grow : The sharing economy is largely split between capitalist (Airbnb) and gift (Khan Academy) organizations.
What would your plans and steps for intervention : What would your plans and steps for intervention include? Include detailed steps for planning, change implementation, employee interventions.
Function to the sum the series up to n terms : Ask the user to enter a number n. function to the sum the following series up to n terms
Annual rate of return on this sculpture : What was his annual rate of return on this sculpture?
How will the adjustments affect the organization : Your clinic received $175,000 from the government as fee-for services reimbursements, as well as $80,000 from private payers.
Explain what you can do as a nurse to support your clients : Explain what you can do as a nurse to support your clients in end-of-life care and in supporting their desires. Support response with evidence-based literature.
Propose a solution to the above system : Consultant Company received a contract to design and build ONE system that can support more than 300 different software applications running

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Calculate a checksum that is the modulo 8 sum

How do you calculate a checksum that is the modulo 8 sum of all the bytes in the following packet C4 04 03?

  Key features of keynesian economic systems

What are key features of Keynesian Economic Systems as a distinct macroeconomic transformation from Classical form of Market Capitalism?

  Write to the log before changing the database values

Why is it important to write to the log before changing the database values?

  What is the probability q that a random ticket will be a win

What is the expected value of Wn, the prize you collect for your winning ticket?

  Write a program to calculate gasoline consumption

Write some helpful headings so that your output looks something like this:

  Implement a vpn system that supports pptp

Your report must address the protocols and ports that need to be considered as the firewall policy is created. Prepare a one- to two-page report that addresses these issues.

  What is the accounting break-even quantity

Ignoring tax effects, what is the accounting break-even quantity (rounded to the nearest unit)?

  Why is allowing this redundancy a bad practice

Why is allowing this redundancy a bad practice that one should avoid?

  Distinguish between concurrent and simultaneous

Distinguish between concurrent and simultaneous. A single processor can execute two or more programs concurrently but not simultaneously

  Javadoc-style comments in your code

If you represent books by their titles alone, design a class that you can use to track the books in the pile on your desk. Specify each operation by stating its purpose, by describing its parameters. Then write a Java interface for the pile's meth..

  Distinguish between multicasting and multiple unicasting

When we send an e-mail to multiple recipients, are we are using multicasting or multiple unicasting? Give the reason for your answer.

  Explain why a skewed model makes sense here

Explain why you cannot determine the probability that a largemouth bass randomly selected ("caught") from the lake weighs over 3 pounds.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd