CIS 125 Homework #5 Please submit your pseudocode/flowchart in a Word or PDF file format. For the programs, please submit your completed program in 2 zipped .py files. 50 Points Total Programs –...

1 answer below »
h


CIS 125 Homework #5 Please submit your pseudocode/flowchart in a Word or PDF file format. For the programs, please submit your completed program in 2 zipped .py files. 50 Points Total Programs – Chapter 5 – Repetition Structures (25 Points Each) Directions (Read CAREFULLY and follow COMPLETELY): · Create the following programs in Pythonthat perform the purpose described and show the sample output (with user input where applicable). · Include at least three lines of comments/remarks in each program, including your name, the date, and a description of the program. · Upload your .py source files to Moodle for each of the programs listed. · Add to Homework 5s ’s Word file the output of your program and the screenshot of the run. · Add pseudocode or a flowchart for ONE of the two programs below and add it to your Word/PDF document. · Be sure to adhere to the college and course academic honesty policy. 1. Running and Grand Total Program Create a .py program that asks the user for a maximum number. A loop will then run from 1 to this many times. Each time the loop runs, two user-defined function will be called, each passing in two variables and returning one. The first function will calculate and return the running total (total) based on the loop counter. The second function will calculate and return the grand total. Both running total and grand total are accumulators (total accumulators count and grand total accumulates total). Then, in the loop, the counter value and running total (accumulator) will be outputted as shown in the example below. Separate count and total by a tab and display the grand total as shown in the example. The grand total will be outputted after the loop is finished and is a total of all of the other totals. Enter maximum number: 5 Count:1Total:1 Count:2Total:3 Count:3Total:6 Count:4Total:10 Count:5Total:15 Grand Total:35 The output should be formatted EXACTLY as above. 2. Table Creator Program Create a .py program that will create a table as shown below where the user can specify by user input how many rows and columns to display. Sample: Enter how many columns you want your table to have: 4 Enter how many rows you want your table to have: 3 Row 1 Column 1Row 1 Column 2Row 1 Column 3Row 1 Column 4 Row 2 Column 1Row 2 Column 2Row 2 Column 3Row 2 Column 4 Row 3 Column 1Row 3 Column 2Row 3 Column 3Row 3 Column 4 The main module of the program should do three things: accept in user input for how many columns the user wants, accept in user input for how many rows the user wants, call a user-defined function (module) passing in these two parameters. The function will then print a table using a nested loop as shown above. Use two tabs (\t\t) between each “Row x Column y”. You will have to search online to find out how to not have a print command start a new line. Then, start a new line after each row. Note: If you create a lot of columns, the window may print them on a new line if it is too small to accommodate them all. Homework 5 Chapter 5 Repetition Structures Extra Credit (10 Points Each) 1. Create a .py program that contains a loop. Within the loop, ask the user to enter a number. Multiply this number times 10 and display a message back to the user with the number multiplied by 10 and the result. Continue the loop as long as the product (i.e. result of multiplication) contains a value less than 100. 2. Create a .py program that uses a loop to read in a number from the user. If the user enters a positive integer (greater than 0) output “Congratulations, that’s a positive number” and continue the loop. If the user enters a negative number, end the loop and display the largest value previously inputted.
Answered Same DayNov 12, 2021

Answer To: CIS 125 Homework #5 Please submit your pseudocode/flowchart in a Word or PDF file format. For the...

Sathishkumar answered on Nov 12 2021
130 Votes
Pseudo Code for Total.py
FUNCTION total(old_no,new_no):#User defined function for total for each n
umber
ENDFOR
RETURN old_no+new_no
ENDFUNCTION
FUNCTION grand_total(old_no,new_no):#User defined function for Grand total
ENDFOR
RETURN old_no+new_no
ENDFUNCTION
max_num=int(input('Enter...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here