Question

find the inputs and outputs, create the pseudocode, and desk check Write a program that will...

find the inputs and outputs, create the pseudocode, and desk check

Write a program that will add up the sum of a series of numbers starting at 1 up to the number entered as in 1 + 2 + 3 + 4 + 5 = 15, where 5 was the number entered.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

n = int(input("Enter a positive integer for n: "))

total = 0
i = 1
while i <= n:
    total += i
    i += 1

print("Sum of integers from 1 to {} is {}".format(n, total))


display "Enter a positive integer for n: "
read n

set total to 0

for i from 1 to n
    add i to total
end for

print total

Input: 5, Output: 15
Input: 6, Output: 21
Input: 10, Output: 55
Input: 100, Output: 5050
Add a comment
Know the answer?
Add Answer to:
find the inputs and outputs, create the pseudocode, and desk check Write a program that will...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Write a Marie program that accepts two positive (inputs) two integers and outputs the sum...

    2. Write a Marie program that accepts two positive (inputs) two integers and outputs the sum of both of the integers and all the numbers in between Write a Marie program that determines the largest of a series of positive integers provided by a user. The user will enter a -1 when she is finished. Up to 10 numbers will be provided by the user. Write a Marie program that accepts two positive integers, multiples them by repeated addition, and...

  • This is a C program. please help me to write a pseudocode of the program ....

    This is a C program. please help me to write a pseudocode of the program . also, I want the program In a do...while loop and the screen output should look like in the picture. please help me. 3.1. Write a program that asks the user to continue to enter two numbers (at a time). For each pair of numbers entered, the program calculates the product of those two numbers, and then accumulate that product. For each pair of numbers...

  • Write a multithreaded C program that outputs prime numbers. This program should work as follows: the...

    Write a multithreaded C program that outputs prime numbers. This program should work as follows: the user will run the program and will enter a number on the command line. The program will then create a separate thread that outputs all the prime numbers less than or equal to the number entered by the user. ADD  "comments" to the source code please and a screenshot of the output with steps on how to compile

  • A store is having a sale. The manager wants a program that allows the sales clerk...

    A store is having a sale. The manager wants a program that allows the sales clerk to enter the original price of an item and the discount rate. The program should calculate and display the sale price. find the inputs and outputs, write the pseudocode, and desk check the pseudocode.

  • Write a multithreaded a Java program that outputs prime numbers. This program should work as follows:...

    Write a multithreaded a Java program that outputs prime numbers. This program should work as follows: The user will run the program and will enter a number on the command line, The program will then create a separate thread that outputs all the prime numbers less than or equal to the number entered by the user.

  • use python: Write a program that reads in X whole numbers and outputs (1) the sum...

    use python: Write a program that reads in X whole numbers and outputs (1) the sum of all positive numbers, (2) the sum of all negative numbers, and (3) the sum of all positive and negative numbers. The user can enter the X numbers in any different order every time, and can repeat the program if desired. Sample Run How many numbers would you like to enter? 4 Please enter number 1: 3 Please enter number 2: -4 Please enter...

  • Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a...

    Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a file called Numbers.txt in your the same folder as your Python program. This file should contain a list on floating point numbers, one on each line. The number should be greater than zero but less than one million. Your program should read the following and display: The number of numbers in the file (i.e. count them) (counter) The maximum number in the file (maximum)...

  • Write C program to take four integer inputs from user (A, B, C, D) then, your...

    Write C program to take four integer inputs from user (A, B, C, D) then, your program should return the sum of even numbers (if there any even numbers) and the multiplication of the odd numbers (if there any odd numbers). For example: if A=1, B=2, C=3, D=4, your program will return: sum=6, multiplication=3. if A=6, B=2, C=8, D=4, your program will return: sum=20, multiplication=0. if A=1, B=3, C=5, D=4, your program will return: sum=4, multiplication=15.

  • 1.The following pseudocode algorithm is used to calculate the average of two numbers. Perform a desk...

    1.The following pseudocode algorithm is used to calculate the average of two numbers. Perform a desk check on this algorithm assuming the firstValue is 12.5 and the secondValue is 7.5. You should use a table to show your answer. L1: Program AverageCalculator; L2: Data firstValue as float; L3: Data SecondValue as float; L4: Data average as float; L5: Output “Enter the first Number”; L6: Input firstValue; L7: Output “Enter the second Number”; L8: Input secondValue; L9: average = (firstValue+secondValue)/2; L10:...

  • Program#3(17 points): write a java program (SunDigits) as follows The main method prompts the user to enter an integer number. The method then calls Method Sum (defined blew) to add the digits and re...

    Program#3(17 points): write a java program (SunDigits) as follows The main method prompts the user to enter an integer number. The method then calls Method Sum (defined blew) to add the digits and return their total. The main method then prints the digits total with proper label as shown below Method Sum )is of type integer and takes an integer value. The method recursively adds up the digits and returns their total. Document your code and use proper prompts for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT