Write a program that will ask the user to input a single number N. If the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that will ask the user to input a single number N. If the number is nonzero, a one hundred element row vector named SEQ will be filled with the values 0.01 *N, 0.02*N, 0.99*N, N. Note that this must work for both positive and negative values of N. After filling the vector, the program should ask (yes or no, not case sensitive) if this is correct, where "No" implies that the user wants to enter a new value for N. If the user answers "No," the user should be asked for the revised value of N, in which case it should refill SEQ with the cor- rected values. This should continue until the user answers "Yes" or enters a zero as the revised value, at which point the program terminates. st-er Display the vector values for each number specified by the user. Choice: Allow the user to end by typing 0, or by selecting Yes from a menu. Write a program that will ask the user to input a single number N. If the number is nonzero, a one hundred element row vector named SEQ will be filled with the values 0.01 *N, 0.02*N, 0.99*N, N. Note that this must work for both positive and negative values of N. After filling the vector, the program should ask (yes or no, not case sensitive) if this is correct, where "No" implies that the user wants to enter a new value for N. If the user answers "No," the user should be asked for the revised value of N, in which case it should refill SEQ with the cor- rected values. This should continue until the user answers "Yes" or enters a zero as the revised value, at which point the program terminates. st-er Display the vector values for each number specified by the user. Choice: Allow the user to end by typing 0, or by selecting Yes from a menu.
Expert Answer:
Answer rating: 100% (QA)
Heres a simple Python program that implements the described functiona... View the full answer
Related Book For
The Science And Engineering Of Materials
ISBN: 9781305076761
7th Edition
Authors: Donald R. Askeland, Wendelin J. Wright
Posted Date:
Students also viewed these programming questions
-
In the following reaction, choose the two correct starting materials from (a)-0). 40 "C, THF Br (a) (b) o (c) (d) (e) OHC -Ph Br Br Br Ph O Ph O O Ph (g) () Br- P-Ph (h) Ph Ph Ph Ph Ph Ph Ph Ph Ph Ph...
-
Given the rates in this chart, what is the expected 1-year rate, 1 year from today. Strip Curve (Years) 1 2 34 5 YTM 5% 4% 3% 2% 1%
-
In Exercises find the values of x for which the series converges. n=0 (x + 1)n n!
-
Calculate the expected rate of return on each alternative and fill in the blanks on the row for in the table above.
-
What is market risk? How does this risk affect the operating performance of financial institutions? What actions can be taken by an FIs management to minimize the effects of this risk?
-
Using only the factor formulas given in Table 2.6, derive Equation 7.5 starting with Equation 7.3. TABLE 2.6 Summary of Discrete Compounding Interest Factors. To Find Given Factor Symbol Name P F...
-
Koontz Company manufactures a number of products. The standards relating to one of these products are shown below, along with actual cost data for May. The production superintendent was pleased when...
-
A clinical resear would like to know if his diet program is effective in lowering patients blood pressure. The following patient. Blood pressure before diet blood pressure after diet 1. 15. 12 2. 15....
-
Assume 240 days has passed since the initiation of the currency swap contract. The new exchange rate is US$0.85/C$. Assume that, on Day 180, the 180-day C$ and U.S.$ LIBORs remained the same, at 0.5%...
-
Consider a situation where you have limited data or information. How can mathematical modeling or estimation techniques help you arrive at a reasonable solution?
-
A typical day is 24 hours = 1440 minutes = 86,400 seconds. What are the ODDS you will land on 7:15 either AM or PM (twicein a day)? b. What is the PROBABILITY you will land on 7:15 either AM or...
-
You want to investigate the relationship between color and consumer behavior to help brands choose the right color story for their products and services. There's no denying the impact of color on...
-
What subnet mask should be used to subnet the 192.168.10.0 network to support the number of subnets and IP addresses per subnet shown in the following topology? SW1 25 IP Addresses a. 255.255.255.0...
-
One would usually find the expected contribution of the report to existing knowledge and identify gaps in knowledge in which section of the research report? One would usually find the expected...
-
Howard Inc. had prepaid rent of $95,000 and $107,000 at the end of 2020 and 2021, respectively. During 2021, Howard recorded $260,000 in rent expense in its income statement. Cash outflows for rent...
-
Quadrilateral EFGH is a kite. Find mG. E H <105 G 50 F
-
Does water freeze at 0C and boil at 100C? Explain.
-
We apply 10 V to an aluminum wire 2 mm in diameter and 20 m long. If 10% of the valence electrons carry the electrical charge, calculate the average drift velocity of the electrons in kmh and milesh.
-
Using Schmids Law, the resolved shear stress operating on a slip direction/plane is given by r = cos cos . If either of these angles equal 90, what happens to the dislocations involved?
-
10.A company contracted with a marketing firm to construct software and create a business website. A quote was requested and accepted. Sometime later, the business asked for updates and revisions but...
-
George Oppenheimer, an agent for Wellington Farms of Massachusetts, Inc., had contacted Mark Kiriakou from the Capital Area Food Bank regarding an order for frozen turkey meat. In an exchange of...
-
Extreme Machine manufactures machines and parts for various industries; they have an office in Youngstown, Ohio. Avery Dennison manufactures and sells labels from a plant in Mentor, Ohio. They use...
Study smarter with the SolutionInn App