Save this video free

Python (Fall 2026) Module 5-10: A5 Explanation

Bill Moseley, Ph.D. - Computer Science Educator · 12:41 · Watch on YouTube

Part of Bakersfield College COMP B10. See all 36 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Bill Moseley explains Assignment 5, an “advanced calculator” that wraps simple area calculations in a text menu. Users choose rectangle or triangle with R or T; an if/elif/else branch gathers dimensions, converts inputs to integers, calculates area, and gives an error message for unrecognized choices.

Key takeaways

Chapters

0:00 Assignment 5: Plan a Menu for Rectangle and Triangle Calculators
3:18 Build R/T Choices and Handle Invalid Menu Input
8:21 Calculate Shape Areas, Test Results, and Review the Program

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:01 So A5, keeping all of that in mind, A5 is called  the advanced calculator. Now this is the same type of calculator that we used in A4, where we  just said input your number or your two numbers, and then we will do a calculation and present  the result. In this case, we're going to allow the user to choose which calculator they want to  use. So, an example of this is, maybe I want the user to have the option to calculate the area of a  triangle versus the area of a rectangle. Okay. So, I'm going to first, I'm going to ask the user,  I'm going to tell the user, you know, welcome to my calculator program. And then I will say, enter  one for the, calculate the area of a rectangle.

1:00 Enter two to calculate the area of a triangle.  And then once they've chosen, I'm going to, I'm going to use an if and else to branch into  different areas where I have to ask them different things for each of those shapes, and then it will  use a different formula and print the result. Okay. So, let's take this, let's take  this into the code here. And once again, actually, I'm going to, I'm going to save  this part because I'll reuse it. Okay. So, first we're going to welcome a user. I'm  going to use comments first here. Present the choices.

1:58 Get user input on which calculator, and then we are going to  branch to each calculator. And so I'm going to do, first was, one is going to be get rectangle input, calculate rectangle, print results. Okay, so this, I'm  going to actually tab those in,

2:52 because that's going to be under the if. And then my else here is going to be  the triangle. So get triangle input,

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Bill Moseley, Ph.D. - Computer Science Educator.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.