Solved og in to jupyterhub using your pipeline credentials

Transcribed image text:

og in to jupyterhub using your pipeline credentials (refer to previous labs if you have questions about how to log in.) reate a source file called budget.py using the Python file editor (Refer CLA3 for how to use Python File in jupyterhub ollow these instructions: – at a jupyterhub menu select File –> New Launcher, then select Python File: – This will open a new file with untitled.py as the name. Rename the file by right click on the rename in the left side list and naming it Rectangle.py . – Write a python program that meets the given problem specification. – Problem Specification: – Include the following information as comments at the top of your program (file name, your name, Today’s date, short description of the program) – Write a program that asks the user to enter the amount budgeted for a month. (NOTE: Use appropriate functions to display the prompt as specified in the Sample Run; use the correct type conversion functions) – The program should also prompt the user to enter each of their expenses for the month and maintain a running total. Loop must exit when user enters 0. (NOTE: Your program should use while loop) – When the loop finishes, the program should display the amount Budgeted and amount spent. Also display a message based on whether the user has spen over budget (See: Sample Run 1), exactly the budget amount (See: Sample Run 2), or under budget (See: Sample Run 3). (NOTE: Your program should print messages as shown in the Sample Runs.) Sample Run 1: Enter amount budgeted for the month: 100 Enter an amount spent(0 to quit): 25 Enter an amount spent(0 to quit): 30 Enter an amount spent(0 to quit): 25 Enter an amount spent(0 to quit): 15 Enter an amount spent(0 to quit): 10 Enter an amount spent(0 to quit): 0 Budgeted: . Spent: . You are over budget. Plan Better Next Time! Sample Run 2: Enter amount budgeted for the month: Enter an amount spent(0 to quit):
Enter amount budgeted for the month: Enter an amount spent(0 to quit): Enter an amount spent(0 to quit): Enter an amount spent( 0 to quit): Enter an amount spent( 0 to quit): 0 Budgeted: \$75.90. Spent: . Spending matches budget. Good Planning! Sample Run 3: Enter amount budgeted for the month: Enter an amount spent( 0 to quit): Enter an amount spent( 0 to quit): Enter an amount spent( 0 to quit): 0 Budgeted: . Spent: . You are under budget. Well Done! – Save the file as budget.py by clicking on File on the menu bar, then click on “Save Python File …”. Type in budget.py as the file name in the save dialog box. Please do not use Save Python File As – To execute the program you need to use the Linux terminal – Open the Linux terminal, go to the directory where you save your file using the cd command Type the following command jovyang@jupyter: python3.10 budget.py – If you have any errors, fix them, save the changes in the file window, and re-run the program ogram works, then prepare a log file (cla9a.log) including a test run of your program using the following commands. (The following captures your terminal session in called cla9a.log). e color statements are the commands to be executed. icript cla9a.log

Read more here: Source link