For this activity, you may work alone or with 1-2 of your neighbors.
Come up with an algorithm (pseudocode) to solve at least one of the following problems.
Then, every team member will use PyCharm to record the pseudocode in a Python file.
Note: You are not implementing anything, simply type you pseudocode.
Reminder: Always check your pseudocode.
print("Pseudocode for enter-the-problem-you-solve")
print("step1 or line1 of your pseudocode")
print("step2 or line2 of your pseudocode")
print("step3 or line3 of your pseudocode")
...the rest of your pseudocode...
# Done!
Run
iconRun
Run
Run
Why do we use Python and PyCharm for this activity?
Can't we simply record our pseudocode using some text editors?
In reality, yes. For this activity, no.
In addition to helping you practice writing pseudocode,
this activity is to help you verify if your installation is successful
and everything is functioning;
so you will be ready for the next class meeting (and start programming).
Imagine that the user specifies the width of a grid, as well as a tile.
You will return either "True" or "False" depending on
whether or not the tile is along the diagonal of the square grid.
For example, on a 7x7 grid,
assuming the tile numbers (starting at the top-left corner)
are 1, 2, 3, ..., 49
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | ||||||
15 | ||||||
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | |||||
36 | ||||||
43 |
row = (tile - 1) // width
col = (tile - 1) % width
Imagine that the user specifies the width and height of a grid, as well as a tile.
You will return either "True" or "False" depending on
whether or not the tile is along the edge of grid.
For example, on a 7x8 grid,
assuming the tile numbers (starting at the top-left corner)
are 1, 2, 3, ..., 56
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | ||||||
15 | ||||||
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | |||||
36 | ||||||
43 | ||||||
50 |
row = (tile - 1) // width
col = (tile - 1) % width
Imagine that the user specifies the width and height of a grid, as well as a tile.
You will return either "True" or "False" depending on
whether or not the tile is in the middle row of the grid.
For example, on a 7x8 grid,
assuming the tile numbers (starting at the top-left corner)
are 1, 2, 3, ..., 56
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | ||||||
15 | ||||||
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | |||||
36 | ||||||
43 | ||||||
50 |
row = (tile - 1) // width
col = (tile - 1) % width
Imagine that the user specifies with width and height of a grid.
You will return a string that represents all ordered tiles that make up the
corners of the grid, with three tiles to a corner.
You will return a string where each tile has a space after it
(this will simplify your algorithm).
For example, on a 7x10 grid,
assuming the tile numbers (starting at the top-left corner)
are 1, 2, 3, ..., 70
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 14 | |||||
15 | ||||||
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | ||||||
36 | ||||||
43 | ||||||
50 | ||||||
57 | 63 | |||||
64 | 65 | 66 | 67 | 68 | 69 | 70 |
row = (tile - 1) // width
col = (tile - 1) % width
Imagine you are writing a program that allows a customer to have a name added to a plaque.
When a customer enters a name and click the Show cost
button,
your program will compute the cost, each letter costs $5, and
then show how much it will cost to the customer.
If the customer clicks the Show cost
button without entering anything,
display a message telling the customer to enter a name.
Optional: you may consider and handle any special cases
Imagine you are writing a program that accepts a paragraph from a user. Your program then checks for repeated words and reports pairs of line numbers and repeated words.
Welcome! In this course, we have two main goals - to teach teach youThe program will report
the skill of programming and and and the art of computer science.
Having the ability to write to write and understand simple programs has
has become increasingly more important. The concepts and principles you
pick up in this class will give you give the ability to take an algorithm
or problem in your chosen field and write a program that will help you do
your job quicker, quicker, easier, and more reliably.
(1, teach), (2, and), (7, quicker)
(1, teach), (2, and), (3, has), (7, quicker)
Imagine you are writing a program that accepts six project scores from the user.
All scores are out of 100 points, except the first (which is out of 30)
and the fifth (which is out of 50).
The program allows a user to specify whether the lowest project score will be dropped.
The program then computes and displays the highest average score for the projects.
For example, if a user enters
Score for project 1 = 15
Score for project 2 = 55
Score for project 3 = 55
Score for project 4 = 55
Score for project 5 = 25
Score for project 6 = 55
With the lowest project score being dropped, the highest average score will be 54
Without the lowest project score being dropped, the highest average score will be 53.33