Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pro 1 Using your Python IDE, writ a Python program to do the following: Prompt the user for a number of rows in the range

pro 1

Using your Python IDE, writ a Python program to do the following:

  • Prompt the user for a number of rows in the range 1 to 10, with 0 stopping the program
  • Stop the program if the number of rows is 0
  • Print an error message and loop back if the number of rows is out of range
  • Prompt the user for a number of columns in the range 1 to 10
  • Print an error message and loop back if the number of columns is out of range
  • Draw a filled rectangle of asterisks ('*') with the given number of rows and columns.
  • Print a blank line and loop back to get new and row and column values

Below is an example of the output of the program when the user enters 7 rows and 9 columns:

 How many rows (1-10, 0 to exit)? 7 How many cols (1-10 )? 9 ********* ********* ********* ********* ********* ********* ********* How many rows (1-10, 0 to exit)? 0 Thank you, goodbye! 

Put comments in your code that describe the purpose of the main sections (what they are doing, not how they are doing it). Put a comment at the top of your program that describes the purpose of the whole program, your name and the current date.

pro 2

The following pseudo-code obtains the age of a user and is supposed to check that the age is within the range 0 to 120. Review and debug the pseudo-code and explain what logic is missing and/or what error(s) it contains.

 Print the message "What is your age?" Read the users input into the age variable While the value in the age variable is in the range 0 to 100 Print the message "The age you entered is out of range" 

pro 3

Program 3: Maths Quest! (due end of week 9)

A local school has asked you to writ a Python program that will allow their students to practice their multiplication / times tables.They have asked you to make the program work something like this example:

(Everything in black is output from your program.Text in red is input using the keyboard by the user.)

Welcome to Maths Quest!What is your name?Jeff

Jeff, which times table would you like to practice? (1-12) 6

Ok Jeff: on a piece of paper, write down the 6 times table from 1 to 12.When you're ready I'll show you the answer so you can check your work.

Are you ready? (Enter 'y' to start)n

Are you ready? (Enter 'y' to start)n

Are you ready? (Enter 'y' to start)y

1 x 6 = 6

2 x 6 = 12

3 x 6 = 18

4 x 6 = 24

5 x 6 = 30

6 x 6 = 36

7 x 6 = 42

8 x 6 = 48

9 x 6 = 54

10 x 6 = 60

11 x 6 = 66

12 x 6 = 72

Did you get them all correct? (y/n) y

Great job! Thank you for playing Maths Quest.

Your job:

1. Write the pseudocode for this program so that it correctly manipulates the items in the times table.

2. Using your Python IDE and framework, translate the pseudo-code into Python code.

3. You should always test your code.Describe in a few sentences how tested:

a)If the "Are you ready?" prompt work? (i.e. the program only continues if the student is ready)

b)If the student get the correct message at the end of the program?

(Did you get them correct?Yes - great job!No?Better luck next time.)

4. Like the one shown in class, make a test plan with 8+ cases that demonstrates your code works, e.g.:

User Input Expected Output Actual Output Pass/ Fail?

Are you ready:

n n n y

(3 no, 1 yes)

Prompts user four times:

"Are you ready?"

"Are you ready?" seen 4 times, after 4th time the app proceeds

Pass

Are you ready: y

Program shows the times table

(Program crashes)

Fail

Times table: 4

4x1=4, 4x2=8, 4x3=12...

4x1=4, 4x2=8, 4x3=12...

Pass

Times table: 12

12x1=12, 12x2=24, 12x3=36...

12x1=4, 12x2=8, 12x3=12...

Fail

Upload these files as evidence to the Connect LMS:

1.A Word document containing:

the pseudocode for your program

your test plan in a table similar to the one shown above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Write a program to display red cars with price under 18000.

Answered: 1 week ago