6) Using do while loop, Write a program to calculate the following series: Sum=1+3+5+7+9+11+13+ 15.... +...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
6) Using do while loop, Write a program to calculate the following series: Sum=1+3+5+7+9+11+13+ 15.... + N, the user has to enter the value of N and N should be odd and positive number, if N was entered as an even or negative number you should display the message "Wrong Input!". Otherwise, calculate the series. 6) Using do while loop, Write a program to calculate the following series: Sum=1+3+5+7+9+11+13+ 15.... + N, the user has to enter the value of N and N should be odd and positive number, if N was entered as an even or negative number you should display the message "Wrong Input!". Otherwise, calculate the series.
Expert Answer:
Answer rating: 100% (QA)
a To find EmaxX1 X2 and EminX1 X2 we first need to find the probabilities for the maximum and minimu... View the full answer
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
A 0.5kg ice hockey puck is tied to a 2m long string nailed down to an ice-skating rink (assume frictionless ice). The hockey puck is rotating around in a circular path at the end of the taught string...
-
Find the laurents series f(z)= 1/(z-1)(z-2) (i) |z| <1 (ii) 1 2
-
Outdoor Living produces outdoor teak furniture in a three-stage process that includes Milling, Assembling, and Finishing, in that order. Direct materials are added in the Milling and Finishing...
-
Find a polynomial function (x) of least degree having only real coefficients and zeros as given. Assume multiplicity 1 unless otherwise stated. 1 - 3, 1 + 3, and 1
-
Derive the frequency equation for the torsional vibration of a uniform shaft carrying rotors of mass moment of inertia \(I_{01}\) and \(I_{02}\) one at each end.
-
Messier Inc. manufactures cycling equipment. Recently, the vice president of operations of the company has requested construction of a new plant to meet the increasing demand for the companys bikes....
-
Two long wooden beams of square cross section / x = 0.1 m are butt-jointed using an epoxy adhesive. The adhesive was stirred before application, trapping air bubbles which, under pressure in forming...
-
1. Bare cost and total cost (incl. O&P) of formwork for spread footings (20 pts, specify which lines (or index) in RSMeans data are used) 2. Bare cost and total cost of reinforcement for spread...
-
Let S = {a, b, c, d, e, f, g} be a collection of objects with benefit-weight values, a: (12,4), b: (10,6), c: (8,5), d: (11,7), e: (14,3), f: (7,1), g: (9,6). What is an optimal solution to the 0-1...
-
1. 2. Indicate the errors, if any, in the following Java statements: a. int 5; b. int x-25; IX variable name is missing //variable name starts with # c. int age-20; // whitespace in variable name d....
-
Question 1 This is a 2-part question: You're in the cafeteria with two colleagues, Jessica and Kim. Kim is Asian. Jessica sees Kim's phone background. It is a picture of her husband. Jessica says,...
-
Introduction World renown Archeology Professor J. has discovered the mystical pyramid of X, which is believed to hide a number of priceless treasures. The inside of pyramid X is divided into...
-
After one year, on March 1, 2023, the spot rate curve has risen +6% across all maturities, so that the new spot rate curve is as follows: YEAR 1 2 3 4 LO 5 SPOT RATE % 11.25 11.50 11.75 12.00 12.25...
-
TCSS 143 A Programming Assignment 2 Due: May 13th 2023, 11:59 PM on Canvas NOTE: Be sure to adhere to the University's Policy on Academic Integrity. Programming assignments are to be written...
-
Using the Gram-Schmidt method, find an orthonormal form of the following bases and explicitly check the orthogonality between their elements. (a) {n) | n = 1,2,3} with |1) = ix + 2y + 3iz, |2) = i...
-
With your classmates, form small teams of skunkworks. Your task is to identify an innovation that you think would benefit your school, college, or university, and to outline an action plan for...
-
Show the result of rehashing the hash tables in Exercise 5.1. Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x mod 10, show the resulting: a. Separate chaining hash...
-
Java 7 adds syntax that allows a switch statement to work with the String type (instead of the primitive integer types). Explain how hash tables can be used by the compiler to implement this language...
-
Suppose that the edges in an undirected graph G satisfy the triangle inequality: cu,v + cv,w cu,w. Show how to compute a traveling salesman tour of cost at most twice optimal.
-
Describe circumstances that might cause a client to understate assets such as cash and financial investments.
-
What prevents the person who opens incoming mail from being able to abstract cash collections from customers?
-
Select the best answer for each of the following situations and give reasons for your choice. a. You have been assigned to the year-end audit of a financial institution and are planning the timing of...
Study smarter with the SolutionInn App