Menu

Need Help Making Pseudocode Haven T Taken Calculus Yet Ok Admit One Might Look Nasty Read Q43835667

I need help making a pseudocode for this:

But I haven’t taken Calculus yet! OK – we admit, this one mightlook nasty, but read on because it’s not that bad. One of thethings that computing folks do A LOT (especially CS students) isanalyze how long a program takes to run. In the first step,something might take 1 unit of CPU time. The second step might take2, the third 3 and so on. Mathematically, that would be expressedby the “summation” operator as this: ∑ =1 This is may lookcomplex, but all it’s saying is that i goes from 1 to n and you sumall those numbers together. So, if (n = 10), ∑ = 1 + 2 + 3 + 4+ 5 + 6 + 7 + 8 + 9 + 10 = 55 =1 Fortunately, this reduces to asimple formula. When summing numbers from 1-n, the sum is:(n+1)*n/2 Why? It’s all in how you “pair” the numbers together. Inthe example above, we could pair (1+10)=11, (2+9)=11, (3+8)=11 andso on. That is, we have n/2 “pairs” of (n+1). Your task is, withoutusing a loop (which we haven’t covered yet), to write a programthat asks the user for a number, then prints out the sum of 1 tothat number. If you use a loop, you will receive no credit. SampleOutput: Enter a number: 3 The sum of the numbers between 1 and 3 is6 Sample Output #2: Enter a number: 10 The sum of the numbersbetween 1 and 10 is 55 Sample Output #3: Enter a number: 15 The sumof the numbers between 1 and 15 is 120

Expert Answer


Answer to I need help making a pseudocode for this: But I haven’t taken Calculus yet! OK – we admit, this one might look nasty…

OR