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

  Write a program that asks the user to enter a string

Write a program that asks the user to enter a string. Create a pointer called strPtr and print the first character, third character and fifth character from your string using this pointer.

  Write a program that reads strings from the user

Write a program that reads strings from the user and writes them to an output file called userStrings.txt.  Stop processing when the user enters the string "DONE".

  Calculate the time available to display a pixel

consider a raster monitor of resolution 640 x 480 pixels. A non-interlaced scanning is used with horizontal and vertical retrace times of 10 each. Calculate the time available to display a pixel. Assume a scan rate of 50 frames per second.

  Measuring the body fat of the person

One way to determine how healthy a person is by measuring the body fat of the person. The formulas to determine the body fat for female and male are as follows:

  Give an example of fault base testing technique

1. Give an example of fault base testing technique. 2. What is the name of Changes made to an information system to add the desired but not necessarily the required features. 3. All the modules of the system are integrated and tested as complete syst..

  Write a hello console c# application

Use Visual Studio for all of the following: Write a Hello console C# application. Make sure it compiles and runs. Upload Hello.cs 10pts Create a Windows Form application that looks like a common math calculator.

  Show the packet and enter a value for each field

An IPv6 packet consists of the base header and a TCP segment. The length of data is 320 bytes. Show the packet and enter a value for each field.

  Speaking both from your experience and after reviewing

1. Speaking both from your experience and after reviewing the features and settings in Lesson 5, discuss your likes and dislikes of the e-mail applications. 2. Which do you prefer and why?

  Design a symbol table class and a symbol table entry class

Design a symbol table class and a symbol table entry class for some language. Have a look at a compiler for that language to see what the symbol table really looks like.

  Write a program that calculates the average word length

Write a program that calculates the average word length in a sentence entered by the user.

  Underlying array structure

Ef?ciently implement a queue class using a circular array. You may use a vector (rather than a primitive array) as the underlying array structure.

  Features in modern automobile are customer driven

A. What features in modern automobile are customer driven? B. Henry Ford once said something to the effect that the customer can have any color Model T he wants as long as its black. How did the world evolve from (HF) his attitude towards customer ..

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