CSC121 PYTHON Programming Lab

Added on - 16 Sep 2019

  • Dissertation

    type

  • 5

    pages

  • 1646

    words

  • 124

    views

  • 0

    downloads

Showing pages 1 to 2 of 5 pages
_______________________________________________________________________CSC121PYTHON PROGRAMMING_______________________________________________________________________LAB 01DESIGNING ALGORITMS FOR COMPUTER PROGRAMSOBJECTIVESIn this lab assignment, students will learn:- How to design algorithms for computer programs- How to design steps for getting user input- How to design steps for processing- How to design steps for displaying output- How to execute steps by hand and keep track of value changes in variablesGOALSIn this lab assignment, students will demonstrate the abilities to:- Design algorithms for computer programs- Design steps for getting user input- Design steps for processing- Design steps for displaying output- Execute steps by hand and keep track of value changes in variablesINSTRUCTIONANDPROBLEMSThere are five problems in this lab. For each problem, please do thefollowing:(a)Design an algorithm for a computer program to solve the problem. Allalgorithms in this lab should include input steps, processing steps (e.g.steps performing calculations) and output steps.(b)Execute your algorithm by hand and use a table to show value changesof the variables with the test cases provided.The following is an example only. You must use theformatof thisexample in the five programs to receive full credit.Problem to solve:The power of an air conditioner is measured in British Thermal Units(BTU). The higher the BTU, the more heat the air conditioner can bringaway. When people buy an air conditioner, they need to know how many
______________________________________________________________________________________________________________________________________________________________________________________________________________________CSC121Lab 01Page2______________________________________________________________________________________________________________________________________________________________________________________________________________________BTU they need to keep the room cool. Design a program to estimate howmany BTU we need when we install a window air conditioner in a room.This number is determined by the volume of the room. The rule of thumbis that we need 3.5 BTU per cubic foot. The program should ask the userto enter the length, width and height of the room. It should calculate anddisplay the number of BTU needed for the air conditioner.Execute your algorithm by hand with this test case: room length = 15,room width = 11 and room height =10. Create a table to show how thevalue of each variable changes during program execution.Algorithm:Step 1: Input the length of the roomStep 2: Input the width of the roomStep 3: Input the height of the roomStep 4: Calculate volume = length * width * heightStep 5: Calculate BTU needed = volume * 3.5Step 6: Display BTU neededVariable Table:StepRoomlengthRoomwidthRoomheightRoomvolumeBTUneededInput room length15Input room width1511Input room height151110Calculate volume =length * width * height1511101650Calculate BTU needed =volume * 3.515111016505775Display BTU needed15111016505775You need to submit analgorithmand avariable tablefor each problem.Please type and save your answers for all five problems in asingleMicrosoftWord document.You may copy the table from above and just modifyit for your programs.Submit the file to Blackboard for credit. Thedocument should be namedLab01.docxPROBLEM1Mary is a big fan of tropical fish. She has a few tanks of fish at home. Tomaintain a healthy environment for the fish, she needs to add conditioner tothe water once a week. The amount of conditioner added is determined by
desklib-logo
You’re reading a preview
card-image

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document