Question

5. Write the complete program to sum all numbers between 56 and 79. For full credits write the: a) Algorithm (5 points) b) Pseudocode (5 points) c) Flowchart (5 points) d) Test cases (5 points) e) Source code that is put in the Python complier (5 points)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

5. a) Algorithm:

  1. Start
  2. Declare variables named i and sum as integers
  3. Initialize i to 56 and sum to 0
  4. Loop until i reaches 79
    1. Add i to the sum
    2. Increment i by 1
  5. End Loop
  6. Stop

5. b) Pseudocode:

Sum_56_To_79()

// To sum numbers between 56 and 79

{

i:= 0;

sum:=0;

for i:= 56 to 79 do

sum := sum + i ;

write(sum);

}

5. c) Flowchart:

5. d) Test Cases:

There will be only one test case and the output is: 1620

5. e) Source Code(Python compiler):

# variable to store sum
sum = 0
#loop to sum the numbers using range() from 56 to 79 i.e., (80-1)
for i in range(56,80):
    sum = sum + i

#printing the result
print("Sum of number between 56 and 79: ",sum)

Sample Output:

input Sum of number between 56 and 79: 1620 .. Program finished with exit code 0 Press ENTER to exit console.D

Add a comment
Know the answer?
Add Answer to:
5. Write the complete program to sum all numbers between 56 and 79. For full credits...
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
  • Write a Python program (special_sum.py) that calculate a special sum of 4 numbers, all int. The...

    Write a Python program (special_sum.py) that calculate a special sum of 4 numbers, all int. The rule for this special sum is as follow: If one of the entered numbers is 17, then it does not count towards the sum and the numbers entered after it do not count. For full credit, you must use function. Your function should have 4 int as parameters, and returns the special sum (as an int). Call this function specialsum and use main program:...

  • Write a program with loops that compute a.The sum of all even numbers between 2 and...

    Write a program with loops that compute a.The sum of all even numbers between 2 and 100 (inclusive). b.The sum of all squares between 1 and 100 (inclusive). c.All powers of 2 from 20 up to 220. d.The sum of all odd numbers between a and b (inclusive), where a and b are inputs. Note*: For part d, enter 3 and 21 as input Output should be: a. 2550 b. 338350 c. 1.0 2.0 4.0 8.0 ... 1048576.05 d. 120

  • in Java and also follow rubric please 4. Write a complete program to do the following:...

    in Java and also follow rubric please 4. Write a complete program to do the following: Using an input and output files, write a program that will read 20 numbers from an input file called InFile. Sum all even numbers and multiply all odd numbers. Print the numbers read from the input file to an output file called OutFile. Also print the sum of the even numbers and the product of the odd numbers to the output file. Rubric: •...

  • Write a program that receives a series of numbers from the user and allows the user...

    Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he or she is finished providing inputs. After the user presses the enter key, the program should print the sum of the numbers and their average.   >>> totalSum =0 >>> count=0 >>> while True:    number=input("Enter a number or press enter to quit:")    if number =="":        break    totalSum += float(number)    count+=1...

  • In C++ Practice Exercise #3a (Calculator) Warm-Up/Version 1 Write a program that vwill get two numbers...

    In C++ Practice Exercise #3a (Calculator) Warm-Up/Version 1 Write a program that vwill get two numbers from the user and then add them together and display the result. . Step 1: Create algorithm/pseudocode . Step 2 (Optional): Watch this video: https:/lyoutu.beyjucjusHSgg Step 3: Code program Submit: . Algorithm/Pseudocode in a separate file . Version 1 source file. Make sure to upload both files before hitting submit Notes: You just need . As with the other Practice Exercise, you can submit...

  • In java, write a program that gets 10 integer numbers from the user using user input,...

    In java, write a program that gets 10 integer numbers from the user using user input, and then calculates and display the sum of the numbers that have been read.   Program Requirements: Write the program in three versions with three loops. Put all three loops in the main method of your source code. version1:  use a while loop. version2:  use a do-while loop. version 3:  use a for loop. For each version, use a loop to input 10 int numbers from 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 C program to sum up all the odd numbers between a lower limit number...

    Write a C program to sum up all the odd numbers between a lower limit number and an upper limit number provided by a user. The requirements are: First, request the user to provide a lower limit integer number and an upper limit integer number that is larger than the lower limit number, and save them in variables lowerLimit and upperLimit, respectively. If the user has entered an upper limit number (upper Limit) that is NOT larger than the lower...

  • python format: write a program that displays, 10 numbers per line, all the numbers from 100...

    python format: write a program that displays, 10 numbers per line, all the numbers from 100 to 200 that are divisible by 5 or 6, but not both. The numbers are separated by exactly one space My Code: count = 0 for i in range (100, 201):     if (i %6==0 and i %5!=0) or (i%5==0 and i%6!=0):         print(str(i), "")         count = count + 1     if count == 10:         string = str(i) + str("")         print(string)...

  • Write a Java program with a single-dimension array that holds 11 integer numbers and sort the...

    Write a Java program with a single-dimension array that holds 11 integer numbers and sort the array using a bubble sort. Next, identify the median value of the 11 integers. Here are the steps your program must accomplish. algorithm (either flowchart or pseudocode) that you will use to write the program Step 1. Create an Place the algorithm in a Word document. 6. Ste the Step 2. Code the program in Eclipse and ensure the following steps are accomplished. 1....

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