Hi, I'm Moth. A husband and father of two, I enjoy fishing, hiking, DIY projects, playing Fortnite with family, OSRS, restoring a 1991 Nissan 300zx. I'm an overly optimistic jack of all trades.
I'm just beginning my journey. One of the tasks in this course is to participate in the community. This is how I found DEV, and I'm grateful for the opportunity to meet and learn from each of you here.
This section of the pre-course work has a practice for pseudocode, here is my write up, let me know what you think! :
//Algorithm: Make the bed
// Tasks:
// Spread Fancy Yellow Comforter
// Fold Gray comforter
// Stack White pillows
// Stack Fancy pillows
// Pattern recognition:
// Yellow comforter goes on first
// Grey comforter gets folded
// Fancy pillows are stacked on top of white pillows
// Abstraction:
// Ignore pillow cases
// Ignore white sheet
// Sequence:
//1. Event 1: Spread the comforters:
// Conditional: If (a comforter is yellow) {
// Spread it on top
// } else {
// Gets folded
// }
//Debug: A comforter has a stain on it - what do we do?
// Conditional: If (a comforter is stained) {
// Put it in laundry
// } else if (comforter is yellow)
// Spread it on mattress
// } else if (comforter is gray) {
// Gets folded
// }
//2. Event 2: Stack the pillows:
// Conditional: If (pillow is stained) {
// Put it in laundry
// } else if (pillow is white) {
// Put it on bottom
// } else if (pillow is fancy) {
// Put it on top
// }
Top comments (0)